Tumblr audio to XSPF

Yesterday, I was contemplating building a new widget to play all of the songs tagged with specific themes in TheMusic (theme+music), a tumblr group that I’m part of. The more I thought about it, and thought about my limited flash & design skills, I figured I should take a look at existing players than spending the time on building my own.

XSPF (“spiff”) is an open-source XML format for audio playlists. For you other old-schoolers out there, it’s like a really simple version of SMIL. There is a nice open-source flash-based XSPF player out there, so it was simply a matter of getting the tumblr playlist into XSPF.  A short while later, I had whipped out a little perl script to do just that, and it works like a champ.

This quick hack won’t win any programming awards, but in case you might find it useful, here it is!  There is one slight detail that you’ll need to fill in to get around the basic tumblr download-protection “drm”, which I didn’t want to publish, but it’s pretty easy to figure out. If you do, use it responsibly!

Download tumblr2xspf.pl

Also, I’d suggest running this via cron or whatever, and caching the result, but it is written as a CGI for simplicity sake.