Skip to content

Commit

Permalink
Version Bump v33 with new keys and now using SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
02strich committed Nov 9, 2011
1 parent 6f49b42 commit cb58d0d
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 181 deletions.
9 changes: 5 additions & 4 deletions pandora/connection.py
Expand Up @@ -14,8 +14,8 @@ class PandoraConnection(object):
authInfo = {}
authToken = ""

PROTOCOL_VERSION = 32
BASE_URL = "http://www.pandora.com/radio/xmlrpc/v%d?" % PROTOCOL_VERSION
PROTOCOL_VERSION = 33
BASE_URL = "https://www.pandora.com/radio/xmlrpc/v%d?" % PROTOCOL_VERSION
BASE_URL_RID = BASE_URL + "rid=%sP&method=%s"
BASE_URL_LID = BASE_URL + "rid=%sP&lid=%s&method=%s"

Expand All @@ -42,14 +42,15 @@ def authListener(self, user, pwd):

self.authInfo = result
self.authToken = self.authInfo["authToken"]
self.lid = self.authInfo["listenerId"]
return True

def getStations(self):
reqUrl = self.BASE_URL_RID % (self.rid, "getStations")
reqUrl = self.BASE_URL_LID % (self.rid, self.lid, "getStations")
return self.doRequest(reqUrl, "station.getStations", self.authToken)

def getFragment(self, stationId=None, format="mp3"):
reqUrl = self.BASE_URL_RID % (self.rid, "getFragment")
reqUrl = self.BASE_URL_LID % (self.rid, self.lid, "getFragment")
songlist = self.doRequest(reqUrl, "playlist.getFragment", self.authToken, stationId, "0", "", "", format, "0", "0")

# last 48 chars of URL encrypted, padded w/ 8 * '\x08'
Expand Down

0 comments on commit cb58d0d

Please sign in to comment.