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.
- {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/METADATA +1 -1
- {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/RECORD +25 -25
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +14 -2
- spotifywebapipython/docs/index.html +2 -2
- spotifywebapipython/docs/search.js +1 -1
- spotifywebapipython/docs/spotifywebapipython/const.html +3 -3
- spotifywebapipython/docs/spotifywebapipython/saappmessages.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/sautils.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +2 -2
- spotifywebapipython/spotifyclient.py +94 -19
- spotifywebapipython/spotifyconnect/__init__.py +2 -2
- spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +13 -8
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastapptask.py +84 -75
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py +14 -12
- {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/LICENSE +0 -0
- {spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/WHEEL +0 -0
- {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
|
-
|
|
42
|
-
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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 ==
|
|
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 ==
|
|
359
|
+
if payloadDataType == TYPE_TRANSFER_ERROR:
|
|
358
360
|
|
|
359
361
|
# example payload response (Nest Speaker):
|
|
360
362
|
# { 'type': 'transferError',
|
|
File without changes
|
|
File without changes
|
{spotifywebapiPython-1.0.155.dist-info → spotifywebapiPython-1.0.157.dist-info}/top_level.txt
RENAMED
|
File without changes
|