2015 年 3 月更新后从 Spotify 应用程序获取当前曲目信息 [英] Fetch the current track info from Spotify app after March 2015 update

查看:39
本文介绍了2015 年 3 月更新后从 Spotify 应用程序获取当前曲目信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用自动热键从 Spotify Windows 客户端中提取当前曲目信息.

I want to pull out the current track information from Spotify windows client using autohotkey.

虽然这个问题 Spotify 下一首歌的热键解决了一些问题常用 ahk 脚本中的问题(媒体播放问题)(可在此问题中找到:最新的 Spotify 更新:Autohotkeys 脚本损坏a> 及以下),曲目信息快捷方式仍然不起作用.

Although this question Hotkey for next song in Spotify solved some of the problems (the media playback issues) in the commonly used ahk script (can be found in this question: Newest Spotify update: Autohotkeys script broke and below), the track info shortcut still does not work.

^Down:: 
{ 
DetectHiddenWindows, On 
SetTitleMatchMode 2 
WinGetTitle, now_playing, ahk_class SpotifyMainWindow 
;StringTrimLeft, playing, now_playing, 10 
DetectHiddenWindows, Off 
clipboard = %playing%`r`n
return 
}

无论我在播放什么歌曲,这都会给我Spotify free".

This will give me "Spotify free" no matter what song I am playing.

主要问题是这次更新后托盘图标和任务栏图标不再显示当前播放的歌曲信息.只有文本 Windows 间谍可以从任务栏图标中找到,现在是Spotify Free".

The main problem is that the tray icon and the task bar icon stopped showing the currently played song information after this update. Only text Windows spy can find from the task bar icon is now "Spotify Free".

因此,我尝试按照以下问题中的示例获取所有控制列表并提取每个控制列表中的文本:如何从窗口获取文本内容

So, I tried to get all controllist and extract texts in each of them by following the example in this question: How to obtain textual contents from a window

但是,我只能找到两个控件(Chrome_WidgetWin_01"和Chrome_RenderWidgetHostHWND1"),Window spy 可以找到文本Chrome Legacy Window",这就是它找到的全部内容.

But, I could only find two controls ("Chrome_WidgetWin_01" and "Chrome_RenderWidgetHostHWND1") and Window spy can find text "Chrome Legacy Window" and this is all it finds.

有没有办法进一步深入研究?我注意到在 Windows 任务管理器中有 3 个 spotify.exe 实例.研究其他流程会有帮助吗?

Is there a way to dig into this further? I noticed in the Windows Task Manager there are 3 spotify.exe instances. Would looking into other processes help?

附注AHK 窗口信息 1.7 (http://www.autohotkey.com/board/topic/8204-ahk-window-info-17/) 暂时无法下载.所以我只能使用 Decarlo 的 Ahk Window Spy 1.3.3.

PS AHK Window Info 1.7 (http://www.autohotkey.com/board/topic/8204-ahk-window-info-17/) is not available for download at moment. so i could only use Ahk Window Spy 1.3.3 by Decarlo.

哦,我在 http://www.autohotkey.com/board/topic/8204-ahk-window-info-17/page-6但它没有帮助.发现的信息不过是Ahk Window Spy.

Oh, I found the code for AHK Window Info pasted as spoiler at http://www.autohotkey.com/board/topic/8204-ahk-window-info-17/page-6 But it did not help. information found was not more than Ahk Window Spy.

(编辑)来自微软的 UISpy 为我提供了更多信息,但无法在 Spotify 客户端中获取文本.而且,我意识到这在安全性方面是一件好事(否则恶意软件可以读取我的电子邮件密码等).因此,除非 Spotify 客户端想要公开这些信息,否则 ahk 很难或不可能做到这一点.在这种特殊情况下,这是正确的还是任何更重要的方法?

(edit) UISpy from microsoft gives me a bit more info but it's not possible to get texts in Spotify client. And, I realized that it's a good thing in terms of security (otherwise malware can read my email password etc). So, unless Spotify client wants to expose this information, it would be hard or not possible to do this by ahk. Is this correct or any cleaver way around in this particular case?

推荐答案

不再需要此解决方案.歌曲艺术家和标题已重新添加到窗口标题中.

最好的解决方案是将 Spotify 从 FileHorse 降级到 0.9 版本.然后执行以下操作:

The best solution is to downgrade Spotify to a 0.9 version from FileHorse. Then do the following:

  1. 转到C:UsersYOURUSERNAMEAppdataRoamingSpotify
  2. 制作一个新的 empy 文本文件
  3. 将其命名为 Spotify_new.exe
  4. 右键单击该文件并将文件设为只读
  5. 复制此文件并将新文件命名为 Spotify_new.exe.sig
  6. Spotify 需要删除这些文件才能进行自动升级.这两个文件上的只读标志将阻止升级.

我目前在运行旧版本时没有遇到任何问题.

I haven't had any issues running an old version at this point in time.

这篇关于2015 年 3 月更新后从 Spotify 应用程序获取当前曲目信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆