spotifywebapiPython 1.0.155__py3-none-any.whl → 1.0.157__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of spotifywebapiPython might be problematic. Click here for more details.

Files changed (25) hide show
  1. {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/RECORD +25 -25
  3. spotifywebapipython/const.py +1 -1
  4. spotifywebapipython/docs/__init__.html +14 -2
  5. spotifywebapipython/docs/index.html +2 -2
  6. spotifywebapipython/docs/search.js +1 -1
  7. spotifywebapipython/docs/spotifywebapipython/const.html +3 -3
  8. spotifywebapipython/docs/spotifywebapipython/saappmessages.html +2 -2
  9. spotifywebapipython/docs/spotifywebapipython/sautils.html +2 -2
  10. spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +2 -2
  11. spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +2 -2
  12. spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +2 -2
  13. spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +2 -2
  14. spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +2 -2
  15. spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +2 -2
  16. spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +2 -2
  17. spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +2 -2
  18. spotifywebapipython/spotifyclient.py +94 -19
  19. spotifywebapipython/spotifyconnect/__init__.py +2 -2
  20. spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +13 -8
  21. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastapptask.py +84 -75
  22. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py +14 -12
  23. {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/LICENSE +0 -0
  24. {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/WHEEL +0 -0
  25. {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/top_level.txt +0 -0
@@ -38,8 +38,10 @@ TYPE_GET_INFO_RESPONSE = "getInfoResponse"
38
38
  TYPE_ADD_USER = "addUser"
39
39
  TYPE_ADD_USER_RESPONSE = "addUserResponse"
40
40
  TYPE_ADD_USER_ERROR = "addUserError"
41
- TYPE_TRANSFER_SUCCESS_RESPONSE = "transferSuccess"
42
- TYPE_TRANSFER_ERROR_RESPONSE = "transferError"
41
+ TYPE_TRANSFER_SUCCESS = "transferSuccess"
42
+ TYPE_TRANSFER_ERROR = "transferError"
43
+ # not an actual Google Cast zeroconf response; used by this api to denote a launch / config error.
44
+ TYPE_LAUNCH_ERROR = "launchError"
43
45
 
44
46
  SPOTIFY_WEB_API_DEVICEAUTH_REFRESH = "https://spclient.wg.spotify.com/device-auth/v1/refresh"
45
47
 
@@ -144,26 +146,26 @@ class SpotifyConnectZeroconfCastController(BaseController):
144
146
  # launch the spotify app on the device.
145
147
  # this will perform the following steps, initiated via the callback function:
146
148
  # - issues a Spotify Connect Zeroconf `getInfo` request to retrieve info about the device.
147
- # - waits for a `getInfoResponse` message and processes the results.
149
+ # - waits for a `getInfoResponse` (or `getInfoError`) message and processes the results.
148
150
  # - issues a Spotify Connect Zeroconf `addUser` request to login the user to Spotify Connect.
149
151
  # - waits for a `addUserResponse` (or `addUserError`) message and processes the results.
150
152
  self.launch(callback_function=callback)
151
153
 
152
- # wait for the launched spotify app to fully initialize.
153
- # this occurs when we receive an `addUserResponse` or `addUserError` message.
154
+ # wait for the launched spotify app to fully initialize. this occurs when we receive one
155
+ # of the following messages: `addUserResponse`, `addUserError`, `getInfoError`, `launchError`.
154
156
  counter = 0
155
157
  while counter < (timeout + 1):
156
158
  if (self.waitAddUser.wait(1)):
157
- if (self.isAddUserError):
158
- raise SpotifyZeroconfApiError(self.zeroconfResponse.Status, "AddUser request failed", "launch_app", self.zeroconfResponse.StatusString)
159
159
  break
160
- if (self.isGetInfoError):
161
- raise SpotifyZeroconfApiError(self.zeroconfResponse.Status, "GetInformation request failed", "launch_app", self.zeroconfResponse.StatusString)
162
160
  if (counter >= timeout):
163
161
  raise SpotifyZeroconfApiError(0, "Timed out while waiting for a response", "launch_app", "timeout")
164
162
  counter += 1
165
163
 
166
- # one more check to ensure that we launched.
164
+ # check for error conditions.
165
+ if (self.isAddUserError):
166
+ raise SpotifyZeroconfApiError(self.zeroconfResponse.Status, "AddUser request failed", "launch_app", self.zeroconfResponse.StatusString)
167
+ if (self.isGetInfoError):
168
+ raise SpotifyZeroconfApiError(self.zeroconfResponse.Status, "GetInformation request failed", "launch_app", self.zeroconfResponse.StatusString)
167
169
  if (not self.isLaunched):
168
170
  raise SpotifyConnectZeroconfLaunchError("Spotify Cast App could not be launched")
169
171
 
@@ -336,7 +338,7 @@ class SpotifyConnectZeroconfCastController(BaseController):
336
338
  return True
337
339
 
338
340
  # was playback transferred to the device?
339
- if payloadDataType == TYPE_TRANSFER_SUCCESS_RESPONSE:
341
+ if payloadDataType == TYPE_TRANSFER_SUCCESS:
340
342
 
341
343
  # example payload response (Nest Speaker):
342
344
  # { 'type': 'transferSuccess',
@@ -354,7 +356,7 @@ class SpotifyConnectZeroconfCastController(BaseController):
354
356
  return True
355
357
 
356
358
  # did an error occur transferring playback to the device?
357
- if payloadDataType == TYPE_TRANSFER_ERROR_RESPONSE:
359
+ if payloadDataType == TYPE_TRANSFER_ERROR:
358
360
 
359
361
  # example payload response (Nest Speaker):
360
362
  # { 'type': 'transferError',