The lastfmsubmitd project is a replacement for the traditional Last.fm plugin model. Instead of re-implementing networking and caching code in each plugin, player plugins can simply send song information to the daemon, which will take care of the rest.
lastfmsubmitd is written in Python, but requires no extra dependencies. Writing new player plugins should be as painless as possible.
LastMP and lastcd
LastMP is an example player plugin for MPD which uses lastfmsubmitd. It requires py-libmpdclient2 (the official version has been offline/out of date for a while, so you will need to get our version over at Pygmy.)
lastcd is another example plugin which can submit a CD that was played on other stereo equipment. Some additional tools are included to retrieve CD information from MusicBrainz.
Replaying tracks from a CD
If you frequently play music on a home or car stereo system that is not connected to your computer, you may still wish to submit these songs to Last.fm. mbget will read the CD in your computer's CD-ROM drive, query MusicBrainz for its album information, and output it in YAML. This format is like the one lastfmsubmitd uses, but it does not contain the time of submission. Instead of reading from the CD-ROM drive, you can also specify an album with --discid or --albumid. If a list of track numbers is also specified, only those tracks will be printed.
If you are really lazy and don't want to put the CD in, you can use mbfind, specify the album name with --album, and choose the album's MBID from that. (You can also try specifying --artist, but at the moment it does not really work and cannot be used in combination with --album.)
lastcd will take a list of songs encoded in this format, add submission times to them as if they had all just been played in order, and write them to lastfmsubmitd's spool or stdout.
What's New in This Release:
· Close file descriptors, etc, when daemonizing.
· Add missing import in client.py.