Jump to content

How To Stream Pandora In Mplayer?


wrybread

Recommended Posts

I'm working on a touchscreen jukebox program, and I'd *love* to be able to add Pandora to it. Like Saver2 I'm using Mplayer as my backend.

I'm wondering if I might be able to get a few hints for getting Pandora to play inside Mplayer? I'm not interested in ripping streams, simply playing them.

Here's my jukebox app by the way:

http://gizmoware.net/triggerfinger

Thanks for any help.

If you'd prefer email, wrybread at gmail dot you know what.

Link to post
Share on other sites
I'm working on a touchscreen jukebox program, and I'd *love* to be able to add Pandora to it. Like Saver2 I'm using Mplayer as my backend.

I'm wondering if I might be able to get a few hints for getting Pandora to play inside Mplayer? I'm not interested in ripping streams, simply playing them.

Here's my jukebox app by the way:

http://gizmoware.net/triggerfinger

Thanks for any help.

If you'd prefer email, wrybread at gmail dot you know what.

To play pandora in mplayer is simple enough - you just need to get it the audio data by either downloading the data yourself and feeding it to mplayer via a pipe/stdin/etc or you can just give the url (you loose a bit of control over state that way, though)

The "tricky" bit is getting to that point to begin with. The sequence to get audiourls goes something like this:

1. misc.sync: receive server's timestamp and store it for further use

2. listener.authenticateListener OR listener.createListener (anon mode, also step 1 for registering)

3. station.getStations: get a list of stations and store it

3a. if no stations, get a choice from the user and call station.createStation, which returns the new stations's data; same format as getStations'. This is also used to load shared stations

4. playlist.getFragment with a station ID that belongs to the current user. Returns 4 songs with encrypted audio urls. Technically should be using getFirstFragment for the first use of a station, but I don't.

5. decrypt the audio URL, and commence playback.

5a. send feedback with station.addFeedback with info contained in the songinfo dict

other rpcs: listener.addTiredSong,station.addSeed,station.setStationName,station.removeStati

on,station.transformShared,listener.register,listener.getListenerResult

All postdata is encrypted with blowfish. Replies are in plain xml. Audio urls are encrypted (last 48 chars only) with a separate key.

All requests except sync require a timestamp, give it the stamp you got from sync offset to the current time.

In the URL, RID is some sort of route id. When syncing, I set it to String.Format("{0:0000000}P", UnixTime % 10000000) and have done. All i know about it is it must end with P.

listenerId and authToken are used in most requests; these are obtained by any request that returns userinfo: listener.authenticateListener, listener.createListener, listener.register, listener.getListenerResult.

Instead of a complete re-implementation of pandora (like i did), you might try wrapping pianobar, another complete reimplementation, for linux, maybe you can get it to compile under cygwin. As i understand it, it just uses letters etc for commands so it would be a bit simpler to use.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...