My favorites | Sign in
Project Logo
             
Search
for
Updated Aug 05, 2007 by MatthewBrown
Labels: xspf, np.php, Featured
XMLSharablePlaylistFileNowPlayerPHP  
Protocol v1.2, Understanding Last.FM's use of XML Shareable Playlist Files

Introduction

Originally from a Last.FM journal entry.

Details

A few days ago, I noticed that my PHP player stopped being able to obtain metadata. When troubleshooting I noticed that np.php (nowplaying) was reporting streaming=false even though I was streaming the Last.FM stream (last.mp3). Looking around, this seems to be happening to everyone, and it has broken last.fm proxy and any other program that uses np.php to obtain metadata.

I am wondering why the Last.FM people would do such a silly thing.

There are three methods of playing Last.FM stations. One, is the constant stream (last.mp3) method, used by my site, LastFM Proxy, Online Last.FM Player, and many more: using handshake.php to create a session, setting the station with adjust.php, obtaining metadata with np.php, and controlling the stream with control.php. The second is the XSPF method; the method that the Last.FM Client (player) uses, and possibly other players such as Amarok: using handshake.php to create a session, setting the station with adjust.php, obtaining an XSPF via xspf.php, and you submit the metadata back to last.fm. The third is the flash player, which I haven't figured out yet, but I believe it also uses XSPFs.

The difference between the last.mp3 method and the XSPF method is the vehicle which provides you with music. Each loaded XSPF contains information about six tracks: the artist, the album, the track name, the length, the mp3 that is the track, and much more. What?! The mp3 that is the track? That's right. The XSPF method proves that IP addresses with established sessions have access to Last.FM's entire database of MP3s.

Before you start thinking you can play what ever you want, whenever you want; they stop this 'issue' by encrypting the filenames to make them unidentifiable. A user could still create a gigantic database containing the track>mp3 filename translations, although Last.FM only needs to change a single piece of how the filenames are generated to foil this master plan; since the XSPFs are generated on their side, not by the client. It's a reasonably flawless protection against piracy. i would kill to get access to that catalog

So why did they break np.php? The use of XSPFs is a better way to provide the world with your streaming music service. It provides the metadata right along with the track. You also don't have to worry about the functionality of control.php; which I suppose could be cumbersome on the server-side of things (controlling each stream, versus just feeding an mp3 and leaving it up to the application to handle the control).

But, back to the task at hand. np.php is broken. This completely ruins many of the players out there, including mine. We can use the XSPF to get songs and their metadata. But each time you load the XSPF it only contains six tracks; so you're stuck reloading it over and over again to get continuous play. There really isn't an alternate.

As for using this on Windows Mobile, you could in theory use the XSPF Web Music Player with the Flash plugin for Pocket Internet Explorer. The only issue is that, it doesn't load. Humm...

Another way would be to find a media player for Windows Mobile that supports ShoutCast streams and XSPF files. Then figure out how to do the file associations, etc, and have it reload after six songs, and hopefully it will auto-load (like an ASX does with Windows Media Player mobile).

Either of these is much more difficult than, say, putting np.php back to the way it used to be.

And the last way to play Last.FM stations on Windows Mobile? Actually make a Last.FM client for Windows Mobile . I'm chomping at the bit to do this; but, since I don't want to spend the enormous amount of money on a Visual Studio license, it ain't gonna happen. You know who could spend the enormous amount of money on a Visual Studio license, or may already have one? CBS.

And now the moral of the story: Last.FM, please make a Windows Mobile client so I can stop obsessing about this project.


Sign in to add a comment
Hosted by Google Code