»… the last rhythm for me« 21

This is how lastrhythm looks like

It is short after 6’o clock and it is time to provide you a first impression of my latest work. Since a few months I’ve been using Banshee to play my music. Due to some annoying glitches in Banshee (no proper gamin-integration, scrobbling is unreliable) I switched back to Rhythmbox. But I’ve missed one feature very badly: the recommendations plugin of Banshee provides you neat extra informations related to the artist you are currently listening to. But there was a way out: Rhythmbox provides simple Python bindings and so I’ve wrote my own plugin, which does the recommendations-thing for Rhythmbox. It is currently in a very early stage but works for me™. It is not time to create the 0.0.1-tarball, but it would be really cool if a few of you can test it. Just check out https://svn.usrportage.de/lastrhythm/trunk/ and copy the complete trunk-folder to /usr/lib/rhythmbox/plugins/ and restart your Rhythmbox. It would be really helpful if you start Rhythmbox with rhythmbox -D lastrhythm to provide me a sensible output in case of crashes.

My plugin utilizes the fantastic PyScrobbler-code to access to Audiscrobbler-API. It uses the named arguments feature in Python pretty well to fire audioscrobbler-queries and is really handy to use.

Thanks to Sven Herzberg for helping me with some weird GTK-widget issues.

If you are using Debian or Ubuntu please install python-elementtree to make things work.

Filed on 09-02-2007, 05:05 under , , , , , & 21 comments & no trackbacks


Trackback specific URI for this entry

No Trackbacks


  1. V answers:
    published on February 9th 2007, 06:37:11 pm *

    When I change the player to a new songs, Rhythmbox seems to lock up until all the info from Similar Artists is loaded. I don’t think this should happen.

    Also, I’d suggest that when you click on a button, it needs to check if we have the artist or song in our library. If I click on "The Beatles" it should show all the songs I have from them… but if I click in one of his song "Love Me Do" and I have it, it should queue in the playlist.

    Keep up the good work!


  2. Lars Strojny replys:
    published on February 10th 2007, 03:03:34 am *

    I will implement the two features you are suggesting soon. The one thing is to make the WidgetMediater threaded and the other thing is to interact with the Rhythmbox database. The bindings for the database are – to be honest – not very intuitive so it was not just a five minute thingy. Also there is really no documentation (except of a few examples) for the Rhythmbox-API which is the worst thing you can do when you provide APIs.


  3. rosa returns:
    published on February 13th 2007, 10:45:32 pm *

    nice one. i had the same two hints, most important – thread the whole thing and i’ll be satisfied :-)


  4. Giovanni means:
    published on February 26th 2007, 03:31:39 pm *

    Hi Lars!

    your plugin is very cool!

    I’m already waiting for next svn update hoping it will fix problems "AM" were talking about, an some segmentation default errors.

    Furthermore, I think it should be good that, if there is no internet connection or rhythmbox plays a non-tagged/bad-tagged song, lastrhythm window could just be mimimized.

    Another little enancement would be to make lastrhythm window a bit smaller, so that even with 800×600 resolution you can still surf around your rhythmbox library.



    ps: I’m sure that if you ask on rhythmbox-dev mailing list about coding problems, developers will be glad (or at least, ready) to help you! :)


  5. NiKo opines:
    published on March 6th 2007, 12:02:25 pm *

    Hey, this plugin rocks, thanks a lot.

    No problem for me, it just works. Some enhancements suggestions :

    – Suggestions area could be resizable – (and|or) should be vertically positionable (I got a 16:9 screen) – Configuring the number of suggestions would be great – Propose alternate links to last.fm pages (eg. Wikipedia, etc.)

    But anyway this is a great start, thanks for the work :)


  6. Jack Hynes reckons:
    published on April 2nd 2007, 01:05:12 am *

    Okay I can’t seem to make this work. The error message says "Unable to activate plugin Recommendations". I’m running Ubuntu Feisty. This is the output:

    Traceback (most recent call last): File "/home/jack/.gnome2/rhythmbox/plugins/lastrhythm.py", line 4, in from widgetmediator import WidgetMediator File "/home/jack/.gnome2/rhythmbox/plugins/widgetmediator.py", line 2, in import pyscrobbler File "/home/jack/.gnome2/rhythmbox/plugins/pyscrobbler/__init__.py", line 1, in from audioscrobbler import * File "/home/jack/.gnome2/rhythmbox/plugins/pyscrobbler/audioscrobbler.py", line 273, in from elementtree.ElementTree import ElementTree
    ImportError: No module named elementtree.ElementTree

    (rhythmbox:28496): Rhythmbox-WARNING **: Could not load plugin lastrhythm

    (rhythmbox:28496): Rhythmbox-WARNING **: Error, impossible to activate plugin ‘Recommendations’


  7. Lars Strojny supposes:
    published on April 10th 2007, 06:12:24 pm *

    Sorry for the late response, but you need to install python-elementtree before (as mentioned in the article above).


  8. Thomas Ficca states:
    published on February 14th 2008, 07:02:55 pm *

    Is your plugin still available? My noobness is showing because I’m having difficulty downloading it. I’ve tried navigating there with my browser and a GUI svn client with no luck. Thanks for your help


  9. Lars Strojny means:
    published on February 14th 2008, 07:18:33 pm *

    Yes, it is. Try:

    svn co https://svn.usrportage.de/lastrhythm/trunk/ lastrhythm


  10. Thomas Ficca returns:
    published on February 14th 2008, 09:44:36 pm *

    got it, I’m not very familiar with SVN, or the client I was using. I was trying to add the entire repository instead of just "checking out" the /trunk folder. I let ya know how it works!


  11. medeshago says:
    published on February 25th 2008, 05:32:17 pm *

    I’m on Ubuntu and I have python elementtree installed and it stills complains about it:

    File "/usr/lib/rhythmbox/plugins/trunk/pyscrobbler/audioscrobbler.py", line 273, in from elementtree.python import ElementTree ImportError: No module named elementtree.python


  12. Nari responses:
    published on February 27th 2008, 02:35:09 pm *

    To solve this issue under Ubuntu, you need to change line 273 in file audioscrobbler.py:

    from elementtree.ElementTree import ElementTree


    from xml.etree.ElementTree import ElementTree


  13. Hadret replys:
    published on May 22nd 2008, 11:51:17 pm *

    That did the trick and plugin launches but doesn’t work: http://debian.pastebin.com/m4e32e118

    Distro is Debian Sid :o


  14. Lars Strojny replys:
    published on May 26th 2008, 11:16:59 pm *

    Interesting. Could you try hacking the code and add some debug statements in $pluginpath/image/fetchergnomevfs.py. Printing self.url would be the first step.


  15. Lars Strojny replys:
    published on May 26th 2008, 11:12:39 pm *

    This should be fixed in SVN now.


  16. sander replys:
    published on May 25th 2008, 04:02:46 pm *

    The fact that you refered to "/usr/lib/gnome2/rhythmbox" saved my life. It was really frustrating for me not to be able to get the (few) plugins available to work, as creating a "./gnome2/rhythmbox/plugins" didn’t help a lot. Thanks!


  17. Luca Invernizzi replys:
    published on April 30th 2009, 08:56:51 pm *

    It works awesomely. You can just put trunk/* into ~/.local/share/rhythmbox/plugins (plugin local to the user).

    Btw, recently I wrote a little script to import last.fm play counts in rhythmbox. You might want to check it out: http://allievi.sssup.it/techblog/


  18. Wallisson Narciso answers:
    published on May 4th 2009, 05:43:24 pm *

    Nice plugin! Thanks!


  19. spartan2276 returns:
    published on May 9th 2009, 10:40:55 pm *

    This worked for me just fine all I did was copy the entire trunk directory into /home//.gnome2/rhythmbox/plugins.

    I’m running Ubuntu 9.04. so I’m don’t think the rhythmbox dir exists under .gnome2 if not just create it. Also make sure you create the plugins dir as well.

    Remember don’t forget to install python-elementtree via terminal or synaptic Package manager (system>Administration>Synaptic synaptic Package manager. do a search for
    python-elementtree and mark for install and done, restart or start rhythmbox go to edit>plugins and enable the recommendations plugin.


  20. xvi82 states:
    published on July 12th 2009, 01:17:34 am *

    The plugin worked fine with Rhythmbox 12.2 but now doesn’t work with the Rhythmbox 12.3 update. I’ve installed the .deb from getdeb, but I thing that the internal changes of the Rhythmbox update have affected the plugin.

    Until the plugin doesn’t work with the new v12.3 I will use the last update 12.2.

    I love this plugin (sorry for my english, I’m from spain)


  21. Lars Strojny says:
    published on July 12th 2009, 11:57:11 am *

    I’m sorry, I do no longer use Rhythmxbox, so I won’t fix the plugin. Maybe somebody else will overtake it?


Add a Comment & let me know what you think