Skip to content
This repository
Browse code

v34 workaround: Get sync time from JJZ's server. Patch by James Burton.

Bug: lp:988395
  • Loading branch information...
commit 049a0360c92ce6760696cef3a3732d57c95ae75c 1 parent e619141
Kevin Mehall authored April 26, 2012

Showing 1 changed file with 7 additions and 5 deletions. Show diff stats Hide diff stats

  1. 12  pithos/pandora/pandora.py
12  pithos/pandora/pandora.py
@@ -21,7 +21,7 @@
21 21
 from pithos.pandora.xmlrpc import *
22 22
 from pithos.pandora.blowfish import Blowfish
23 23
 
24  
-PROTOCOL_VERSION = "33"
  24
+PROTOCOL_VERSION = "34"
25 25
 RPC_URL = "www.pandora.com/radio/xmlrpc/v"+PROTOCOL_VERSION+"?"
26 26
 USER_AGENT = "Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0 (compatible; Pithos/0.3)"
27 27
 HTTP_TIMEOUT = 30
@@ -169,13 +169,15 @@ def connect(self, user, password):
169 169
         self.rid = "%07iP"%(int(time.time()) % 10000000)
170 170
         self.listenerId = self.authToken = None
171 171
         
172  
-        pandora_time = self.xmlrpc_call('misc.sync', [], [], secure=True, includeTime=False)
173  
-        logging.info("Pandora sync reply is %s", pandora_decrypt(pandora_time))
174  
-        pandora_time = int(pandora_decrypt(pandora_time)[4:14])
  172
+        logging.info("Attempting to connect...");
  173
+        timeurl = urllib2.urlopen("http://ridetheclown.com/s2/synctime.php");
  174
+        pandora_time=int(timeurl.read(),10);
  175
+        logging.info("Synctime is %s", pandora_time)
  176
+               
175 177
         self.time_offset =  pandora_time - time.time()
176 178
         logging.info("Time offset is %s", self.time_offset)
177 179
             
178  
-        user = self.xmlrpc_call('listener.authenticateListener', [user, password], [], secure=True)
  180
+        user = self.xmlrpc_call('listener.authenticateListener', ["",user, password,"html5tuner","","","HTML5",True], [], secure=True)
179 181
         
180 182
         self.webAuthToken = user['webAuthToken']
181 183
         self.listenerId = user['listenerId']

0 notes on commit 049a036

Please sign in to comment.
Something went wrong with that request. Please try again.