Extreme_One Posted October 15, 2006 Posted October 15, 2006 ... But IS it possible to access any info... The info is available somewhere... This project is extracting the info. Quote
cooper Posted October 15, 2006 Posted October 15, 2006 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. Quote
rblok Posted October 15, 2006 Posted October 15, 2006 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. Quote
cooper Posted October 15, 2006 Posted October 15, 2006 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. Quote
Extreme_One Posted October 15, 2006 Posted October 15, 2006 Still "unable to locate artist and song information." Quote
cooper Posted October 15, 2006 Posted October 15, 2006 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. Quote
Extreme_One Posted October 15, 2006 Posted October 15, 2006 /me crosses fingers. GL HF (and don't let the boss catch you) ;) Quote
pandoralover Posted October 16, 2006 Posted October 16, 2006 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... Quote
rblok Posted October 16, 2006 Posted October 16, 2006 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 Quote
Extreme_One Posted October 16, 2006 Posted October 16, 2006 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: Quote
cooper Posted October 16, 2006 Posted October 16, 2006 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? Quote
pandoralover Posted October 16, 2006 Posted October 16, 2006 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? Quote
pandoralover Posted October 16, 2006 Posted October 16, 2006 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<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); Â Â Â Â Â Â Â Â } Â Â Â Â } }; Quote
Extreme_One Posted October 16, 2006 Posted October 16, 2006 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: Quote
cooper Posted October 16, 2006 Posted October 16, 2006 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. :( Quote
jmonee84 Posted October 17, 2006 Posted October 17, 2006 I can't code yet I'll do what I can. Here's giving you my support. Quote
Cynagen Posted October 17, 2006 Posted October 17, 2006 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. Quote
Extreme_One Posted October 17, 2006 Posted October 17, 2006 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? Quote
rblok Posted October 17, 2006 Posted October 17, 2006 use a packetsniffer like ethereal to watch that xml-response Quote
pandoralover Posted October 17, 2006 Posted October 17, 2006 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. Quote
Cynagen Posted October 17, 2006 Posted October 17, 2006 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 Quote
farris Posted October 17, 2006 Posted October 17, 2006 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 Quote
cooper Posted October 17, 2006 Posted October 17, 2006 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. Quote
cooper Posted October 17, 2006 Posted October 17, 2006 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. Quote
Extreme_One Posted October 17, 2006 Posted October 17, 2006 Success!.... Well done! 8) /me looks forward to version 7.4 :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.