Yeah, that does not work. You need to use a different interface to get the mpris metadata from Rhythmbox. And the object path you used for Rhythmbox is wrong. Anyway, the following code should do it:
Code:
sb = dbus.SessionBus()
rb_obj = sb.get_object("org.mpris.MediaPlayer2.rhythmbox", "/org/mpris/MediaPlayer2")
props_int = dbus.Interface(rb_obj, "org.freedesktop.DBus.Properties")
rb_meta_dict = props_int.Get("org.mpris.MediaPlayer2.Player", "Metadata")
title = rb_meta_dict["xesam:title"]
artists = ", ".join(rb_meta_dict["xesam:artist"]) # track can have more than one artist apparently
album = rb_meta_dict["xesam:album"]
cover_art_url = meta_dict["mpris:artUrl"]
# etc...
By doing the above you are getting the metadata dict that contains all the info for the current track (and thus you don't really need to use rhythmbox-client at all.) The full list of the metadata items can be found here. Beware that some values are dbus arrays and you should handle them accordingly like I've done for the artists above.
Hope that helps.
Bookmarks