From 1ebdaa206098482b09424b81f2bdd5e702be31bd Mon Sep 17 00:00:00 2001 From: James Burton Date: Thu, 26 Apr 2012 21:01:32 -0400 Subject: [PATCH] modified: pithos/pandora/pandora.py modified: pithos/pandora/pandora.py --- pithos/pandora/pandora.py | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pithos/pandora/pandora.py b/pithos/pandora/pandora.py index 894ac5b..94c959d 100644 --- a/pithos/pandora/pandora.py +++ b/pithos/pandora/pandora.py @@ -21,7 +21,7 @@ import xml.etree.ElementTree as etree from pithos.pandora.xmlrpc import * from pithos.pandora.blowfish import Blowfish -PROTOCOL_VERSION = "33" +PROTOCOL_VERSION = "34" RPC_URL = "www.pandora.com/radio/xmlrpc/v"+PROTOCOL_VERSION+"?" USER_AGENT = "Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0 (compatible; Pithos/0.3)" HTTP_TIMEOUT = 30 @@ -169,13 +169,15 @@ class Pandora(object): self.rid = "%07iP"%(int(time.time()) % 10000000) self.listenerId = self.authToken = None - pandora_time = self.xmlrpc_call('misc.sync', [], [], secure=True, includeTime=False) - logging.info("Pandora sync reply is %s", pandora_decrypt(pandora_time)) - pandora_time = int(pandora_decrypt(pandora_time)[4:14]) + logging.info("Attempting to connect..."); + timeurl = urllib2.urlopen("http://ridetheclown.com/s2/synctime.php"); + pandora_time=int(timeurl.read(),10); + logging.info("Synctime is %s", pandora_time) + self.time_offset = pandora_time - time.time() logging.info("Time offset is %s", self.time_offset) - user = self.xmlrpc_call('listener.authenticateListener', [user, password], [], secure=True) + user = self.xmlrpc_call('listener.authenticateListener', ["",user, password,"html5tuner","","","HTML5",True], [], secure=True) self.webAuthToken = user['webAuthToken'] self.listenerId = user['listenerId'] -- 1.7.4.4