Welcome to Geoffrey Swift's βlog. Please subscribe to the Atom feed.


Converting XSPF to M3U and PLS with XSLT

I'm now syndicating another internet radio station playlist, the new one is from http://www.dnbstations.co.uk/. This didn't take long to implement, as I was able to reuse existing code which converts from XSPF to both M3U and PLS. I did write some new code to convert a Wimpy play list to XSPF, this was pretty easy as the formats are very similar.

The XSLT code to convert a Wimpy play list to XSPF, and from XSPF to M3U and XSPF to PLS is hereby released into the public domain.

Not only does www.dnbstations.co.uk provide the Wimpy playlist, they act as a proxy for all the streams. This seems to be wasteful of their bandwidth, when they could easily let listeners access the stream directly. I was quite surprised when I noticed this, thinking that the stream URLs were just using HTTP redirects. Maybe they'll redo this in the future, depending on how successful they are!

Comments

I've enhanced wimpy2xspf.xsl, so that it can cope with playlists within playlists. A PHP kludge was necessary since Wimpy accepts XML that isn't well formed.

Comments for this post are now closed.