使用Ubuntu 12.04的Im。我想用Python访问Rhythymbox。如何使用Python获取Rhythmbox中当前播放的歌曲
这是我到目前为止已经着手:
伊夫通过这个网站 https://live.gnome.org/RhythmboxPlugins/WritingGuide走了,但它给出了如何编写插件细节,即时消息在现在没有兴趣。我经历了几个教程,告诉我这样做。
import dbus
session_bus = dbus.SessionBus()
proxy_obj = session_bus.get_object(
'org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player')
但我收到以下错误
DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Rhythmbox was not provided by any .service files.
可能有人请指出我的,我想达到什么样的方向是正确的?
你是指什么访问?你想要做什么*具体*? – 2012-08-13 18:14:38
我只想得到正在播放的歌曲的名称。 – Manoj 2012-08-13 18:17:34
也许你可以看一下'/ usr/lib/rhythmbox/plugins/im-status/im-status.py'中的im-status插件,它会把歌曲的名字放在pidgin/empathy中 – solarc 2012-08-13 18:23:12