Jump to content

New version of Pandora?


Recommended Posts

  • Replies 128
  • Created
  • Last Reply

Top Posters In This Topic

Okay, dug around a bit.

In the pandoraGrabber.html file on line 162 there is the embedding of the PandoraEvents.swf which is the component that calls the javascript functions which receive the artist and title.

Pandora recently updated this swf file so you need to change that filename to 'http://www.pandora.com/PandoraEventsv2.swf' at which point those functions should be called once again.

The reason it broke in the first place was because the old events swf was removed from the server.

Link to post
Share on other sites

i don't think that it will be enough to change line 162,

because the .swf is in <object> AND <embed>.

Also is there is a id- and a name-tag "pandoraEvents" which i changed "PandoraEventsv2" but the artist/title is always unrecognized.

Link to post
Share on other sites

Okay, did some more digging.

The "pandoraSongPlayed" javascript function will get called with 3 rather than 2 parameters (the 3rd being 'backstageurl', whatever that may be).

The function is defined in js/pandora.js line 17.

Change: function pandoraSongPlayed(song, artist) {

to: function pandoraSongPlayed(song, artist, ignoreme) {

See if that helps any (obviously you still need to include the Eventsv2 thing I mentioned before).

And if you were wondering: No, I don't run pandora.

I run Linux everywhere and I use ALSA for sound. Flash and ALSA (well, for the current versions of Flash anyways) don't mix.

Link to post
Share on other sites

This really sucks. I was hoping to bring the backend in line, but clearly it's the front end that's broken. :(

I'm gonna try to work on this at work tomorrow. At least I can play with a Windows box there which should make this testing stuff a wee bit quicker.

Link to post
Share on other sites

I just ran pandora.com through a javascript debugger and it looks like it now calls songPlayed with a hashed string as the only argument. Looks like they are hashing the song info.

We could follow the backstage link but I dont think the link is generated until you click the up-arrow->backstage->song button.

We could also do the memory snooping but that is a lot harder on Linux systems (and it would be nice to keep this multi-platform).

I could be wrong on all this as I am new here, but I think they may have stopped passing the song info around in plain text...

Link to post
Share on other sites

i dont think its hashed; on Post Request:

POST /radio/xmlrpc/v8?rid=2318513P&lid=12732285&method=

getFragment&arg1=144774190690617213&arg2=6179761&arg3=5618009151 HTTP/1.1

it gets <methodResponse>

<params>

<param>

<value><array><data>

<value><struct>

<member><name>artistSummary</name><value>Ian Pooley</value></member>

<member><name>artistDetailURL</name><value>http://www.pandora.com/music/artist/059cd768ed12b93b</value></member>

<member><name>matchingSeed</name><value>S325359</value></member>

<member><name>songDetailURL</name><value>http://www.pandora.com/music/song/e8d0572c48be9b22</value></member>

<member><name>albumDetailURL</name><value>http://www.pandora.com/music/album/4811d3995f729c35</value></member>

<member><name>webId</name><value>e8d0572c48be9b22</value></member>

<member><name>musicComUrl</name><value>

http://search.music.com/?b=470286336%7C107...1551368192&

queryType=batchPage&title=&name=&keywords=&q=

Ian+Pooley+A+Subterranean+Soundtrack&querySrc=pandora</value>

Seems to be a urlencoded xml-file

Link to post
Share on other sites

When I include a javascript file in the pandoraGrabber.html containing the following, I intercept all sorts of calls:

 // Shamelessly ripped out of PandoraFM.real-ity.com

Pandora = {

    fireEvent: function(eventName, args) {

        alert("fireEvent: #"+eventName+"#");

        if (eventName == "SongPlayed") {

            alert("Hey, we're playing a song... But what's in args?");

            alert(args);

        }

    }

};

The problem is that damned args object. I don't know much about Javascript, so I don't know how to dissect that args object. Currently that last alert will simply spit out "Object" which isn't particularly helpful.

Anybody out there with a knack for Javascript?

Link to post
Share on other sites
When I include a javascript file in the pandoraGrabber.html containing the following, I intercept all sorts of calls:

 // Shamelessly ripped out of PandoraFM.real-ity.com

Pandora = {

    fireEvent: function(eventName, args) {

        alert("fireEvent: #"+eventName+"#");

        if (eventName == "SongPlayed") {

            alert("Hey, we're playing a song... But what's in args?");

            alert(args);

        }

    }

};

The problem is that damned args object. I don't know much about Javascript, so I don't know how to dissect that args object. Currently that last alert will simply spit out "Object" which isn't particularly helpful.

Anybody out there with a knack for Javascript?

This might work (cant test it right now):

Pandora = {

    fireEvent: function(eventName, args) {

        var argstring = "";

        

        for(var i=0;i&lt;args.length;i++){

            argstring = argstring + " " + args[i];

        }

        alert("fireEvent: #"+eventName+"#"+"#args " + argstring);

        if (eventName == "SongPlayed") {

            alert("Hey, we're playing a song... But what's in args?");

            alert(args);

        }

    }

};

Link to post
Share on other sites
The OpenPandora project has found the artist + track info.

My rudimentary examination shows that he's parsing/ gathering XML data.

But I'm just a user not a coder/hacker. :oops:

I was unable to find the source for openpandora. Is it publicly available?

I wish!

Can it be decompiled?

The XML files appear within temp folders... maybe they can provide some info...?

But I'm just a user not a coder/hacker. :oops:

Link to post
Share on other sites
This might work (cant test it right now)
I tried with a hardcoded args[0], args[1] and args[2] in an alert, and that yielded 3 "undefined" strings. :(
Link to post
Share on other sites

You guys are at least getting close, can you point me out to the XML file? If I can use some of my PHP magik to open up that XML and dump some data from it, I might be able to find what we're looking for and just replace the pandora's jar grabbing stuff, and replace the jar with a .exe instead containing all the code we need.

I'm not seeing the XML files people are talking about, but the javascript is working to announce what's going on, so that's a plus.

Link to post
Share on other sites

It might be worth keeping an eye on this post over at the last.fm forum.

Some guy has made a Firefox extension which scrobbles from Pandora.

It stopped working with the update to Pandora.

If he updates it to cover the new Pandora API then shouldn't it be fairly easy to see where he's getting the artist/track data from?

Link to post
Share on other sites

I think some of those projects have actually been given access to a pandora API. So they may not be reverse engineering it like we are having to do.

I used ethereal to sniff (luckily it can uncompress gzip on the fly) but I didnt find anything useful (did not have a lot of time to look).

The best bet would be to use a memory snooper but even that can be worked around.

Link to post
Share on other sites
I think some of those projects have actually been given access to a pandora API. So they may not be reverse engineering it like we are having to do.

I used ethereal to sniff (luckily it can uncompress gzip on the fly) but I didnt find anything useful (did not have a lot of time to look).

The best bet would be to use a memory snooper but even that can be worked around.

Here's the problem, ethereal is not exactly integrated into any major coding language, and would take a lot of adapting to be able to make the text version fit in and do it's job properly. We're looking at loads of work just to packet snoop, here's an easier idea, proxy pandora.com to another local IP through the HOSTS file/DNS server on your router, and have it read the information the real pandora.com is sending and blindly relay to the machine making the request.

Our machine->router->proxy machine (capture point)->pandora.com

Link to post
Share on other sites

idk if this will help, ive been trying to follow this because that would be great if you could get this working again, but apparently this guy has an api for pandora or something...his program works complete with reading song titles and such

he calls it a wrapper but since he reads the titles to the title bar of the window as well as the tray icon there must be a way to extract it from pandora

just thought id share that

i wish i could help more but all the coding i know it html and what i wouldnt even consider beginner C so ya

Link to post
Share on other sites

Oh, we know it can still be done. It's just a matter of digging to find the location of the relevant data. I don't think sniffing the traffic will aid this very much. The data is eaten by the Pandora player applet, and exported to the browser through some other means. There's no telling if the data will still be in that same format. It might be interesting to reverse-engineer the player's protocol so you can just download the files, play them and save them, and not have to dick around with Flash 8 which is clearly pissing some people off. But that would be a different project. Let's work on getting this one going properly again first.

Link to post
Share on other sites

Success!

// Shamelessly stolen from PandoraFM.real-ity.com

Pandora = {

    fireEvent: function(eventName, argument) {

        if (eventName == "SongPlayed") {

            pandoraSongPlayed(args.songName, args.artistName);

        }

    }

};

How I got this:

I ran Pandora's Jar with that last posted snippet of Javascript code I posted in my browser while running Venkman, the Javascript debugger of the Mozilla project. There's a plugin for Firefox too if you want to play with it. This is some seriously cool stuff.

I set a breakpoint at that alert inside the if-statement so I only get a call from the debugger when the 'SongPlayed' event came by. At that point I could just inspect the object that was passed to the method, see what attributes it had. It was easy as pie really.

I've updated the Noobs Guide page so that it now shows a download to the fixed version of the program.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...