Unlocking Pandora’s Music Box
A friend mentioned to me recently that the Pandora music service was a great way to listen to music online and learn if there’s any similar music you might like. It’s actually a very neat service from the point of view that its creators have analyzed the characteristics (”musical DNA”) of various artists’ music and categorized them. If you tell them that you’re a big Morrissey fan, they look at the characteristics of Morrissey’s music and identify artists whose music is similar. Then they play music by those artists, giving you a chance to see if you like any of them. If you do, more of their music will appear in the stream you receive. If you don’t, they stop the song and quit playing that artist.
The same friend who told me this mentioned that Pandora downloads its
music to your machine in MP3 format, then plays it through the
browser-based application. (At least, he thought he’d heard that
somewhere on the Internet.) The browser-based application is
written in Macromedia Flash and does indeed play streamed MP3s from
Pandora’s server. The MP3s are not stored on your computer,
though. They’re pulled down as needed. Or you can pull them
down yourself..
Open your Windows Explorer and browse your
way to the following directory:
new,courier,monospace;"><your account name> style="font-family: courier new,courier,monospace;">\Local
Settings\Temporary Internet Files
/>(Replace the "<your account name>" part with the name
of your Windows XP login account.)
When the file list
appears, click on the "Internet Address" column at the top of
the file display. Look for a file with an Internet Address that
looks something like this
"http://www.pandora.com/radio/xmlrpc/v3?rid=" followed by a
bunch of other data. The file’s name will start with that
"v3?rid=" part as well. Copy this file to your
desktop. Open it with Firefox or NotePad. If you have found
the right file, it should have some text in it like this:
/>
new,courier,monospace;"><member>
style="font-family: courier new,courier,monospace;" /> ><name>songTitle</name>
style="font-family: courier new,courier,monospace;" /> ><value>Parents Just Don’t Understand
(Single Edit)</value>
</member>
style="font-family: courier new,courier,monospace;" /> >.
.
style="font-family: courier new,courier,monospace;">.
style="font-family: courier new,courier,monospace;" /> ><member>
style="font-family: courier new,courier,monospace;" /> ><name>audioURL</name> style="font-family: courier new,courier,monospace;">
style="font-family: courier new,courier,monospace;" /> ><value>http://audio-eqx-sjl.pandora.com:80/access?version=4&token=…</value> style="font-family: courier new,courier,monospace;">
style="font-family: courier new,courier,monospace;" /> ></member>
/>(If the file you tried doesn’t have this kind of text in it, look for
one of the others in the same place whose name is similar. Most
likely the file you’re looking for is one of the larger ones. The
"right" file was the only one that was 8KB in size on my
system.)
The interesting part about this file is that
"<value>" line under "audioURL". If you
were to take that text (which I’ve modified above so it doesn’t work)
and copy everything starting with "http://audio-eqx" and
ending just before "</value>", then paste that into the
"Location" bar of a web browser, you’d find that it downloads
a file called "access" to your computer. If you were to
rename that file from "access" to (for example) "Parents
Just Don’t Understand (Single Edit).mp3" what you’d find is that
you suddenly have an MP3 of the song.
That MP3 would download
to you at a pretty speedy rate depending on your system’s Internet
connection. In my limited experiments over a cable modem
connection the transfer rate was something like 384K/second. The
resulting file is an MP3 whose sample rate is 44kHz, 2-channel stereo,
and a bit rate of 128kbps. ID3 tags are NOT filled in for the
file.
I would imagine that it wouldn’t take a lot of
creativity or skill to write a program that locates the correct XML file
in your Temporary Internet Files, locates the song URLs, pulls them
down, and uses the other fields in the XML file to fill in the MP3’s
ID3v2 tags. And no, I haven’t done that, so don’t ask.
/>Please be advised that the data above
is provided for informational purposes only. I take no
responsibility if you use this information and find yourself in trouble
with the good folks at Pandora, the RIAA, or elsewhere.