Hexxeh / spotify-websocket-api

Spotify Websocket API is a fully open source Spotify library based on the WebSocket API used in the Spotify Web beta
395 stars 67 forks source link

Able to authorise username and password but not able to do anything else #61

Open neo01124 opened 10 years ago

neo01124 commented 10 years ago

The following is the trace. Any ideas how it could be fixed ?

In [1]: from spotify_web.spotify import SpotifyAPI

In [2]: sp = SpotifyAPI()

In [3]: sp.auth('uname', 'pwd') Out[3]: True

In [4]: sp.metadata_request('spotify:track:4O2okbnHlCrU76QdtCE0Bl') spotify:track:4O2okbnHlCrU76QdtCE0Bl 9df2018365cd4f0bb1575732b96a8bcb

[0, 'CjRobTovL21ldGFkYXRhL3RyYWNrLzlkZjIwMTgzNjVjZDRmMGJiMTU3NTczMmI5NmE4YmNiGgNH\nRVQ=\n']

AttributeError Traceback (most recent call last)

in () ----> 1 sp.metadata_request('spotify:track:4O2okbnHlCrU76QdtCE0Bl') /home/varun01124/code/spotify-websocket-api/spotify_web/spotify.pyc in metadata_request(self, uris, callback) 500 args = self.generate_multiget_args(SpotifyUtil.get_uri_type(uris[0]), mercury_requests) 501 print args --> 502 return self.wrap_request("sp/hm_b64", args, callback, self.parse_metadata) 503 504 def toplist_request(self, toplist_content_type="track", toplist_type="user", username=None, region="global", callback=False): /home/varun01124/code/spotify-websocket-api/spotify_web/spotify.pyc in wrap_request(self, command, args, callback, int_callback, retries) 467 if not callback: 468 for attempt in range(0, retries): --> 469 data = WrapAsync(int_callback, self.send_command, command, args).get_data() 470 if data: 471 break /home/varun01124/code/spotify-websocket-api/spotify_web/spotify.pyc in **init**(self, callback, func, _args) 63 64 self.data = False ---> 65 func(_args, callback=callback) 66 67 def callback(self, *args): /home/varun01124/code/spotify-websocket-api/spotify_web/spotify.pyc in send_command(self, name, args, callback) 833 self.seq += 1 834 --> 835 self.send_string(msg) 836 837 def send_string(self, msg): /home/varun01124/code/spotify-websocket-api/spotify_web/spotify.pyc in send_string(self, msg) 843 try: 844 with self.ws_lock: --> 845 self.ws.send(msg_enc) 846 except SSLError: 847 Logging.notice("SSL error, attempting to continue") AttributeError: 'NoneType' object has no attribute 'send'