spotifywebapiPython 1.0.280__py3-none-any.whl → 1.0.282__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.
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +15 -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/spotifymediatypes.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.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/oauthcli/authclient.py +2 -0
- spotifywebapipython/spotifyclient.py +2 -0
- spotifywebapipython/zeroconfapi/zeroconfconnect.py +37 -43
- {spotifywebapipython-1.0.280.dist-info → spotifywebapipython-1.0.282.dist-info}/METADATA +1 -1
- {spotifywebapipython-1.0.280.dist-info → spotifywebapipython-1.0.282.dist-info}/RECORD +25 -25
- {spotifywebapipython-1.0.280.dist-info → spotifywebapipython-1.0.282.dist-info}/LICENSE +0 -0
- {spotifywebapipython-1.0.280.dist-info → spotifywebapipython-1.0.282.dist-info}/WHEEL +0 -0
- {spotifywebapipython-1.0.280.dist-info → spotifywebapipython-1.0.282.dist-info}/top_level.txt +0 -0
|
@@ -426,6 +426,9 @@ class ZeroconfConnect:
|
|
|
426
426
|
# we will process the results with a `ZeroconfGetInfo` object, in case a publicKey was returned.
|
|
427
427
|
result = ZeroconfGetInfo(root=responseData)
|
|
428
428
|
|
|
429
|
+
# trace.
|
|
430
|
+
_logsi.LogObject(SILevel.Verbose, '%s result (addUser %s)' % (apiMethodName, type(result).__name__), result, excludeNonPublic=True)
|
|
431
|
+
|
|
429
432
|
# is the device fully available? The info.Availability property can be used to determine this.
|
|
430
433
|
# if the device is fully available (Availability=""), then the addUser request should return
|
|
431
434
|
# immediately - hopefully with a 0 status (OK) to denote the request was successul.
|
|
@@ -438,7 +441,6 @@ class ZeroconfConnect:
|
|
|
438
441
|
if (result.Status == 203) and (result.StatusString == "ERROR-INVALID-PUBLICKEY"):
|
|
439
442
|
|
|
440
443
|
# trace.
|
|
441
|
-
_logsi.LogObject(SILevel.Verbose, '%s result (%s)' % (apiMethodName, type(result).__name__), result, excludeNonPublic=True)
|
|
442
444
|
_logsi.LogVerbose("Spotify Connect addUser request returned an ERROR-INVALID-PUBLICKEY response for Device id '%s'; addUser will be retried with the returned publicKey" % (info.DeviceId))
|
|
443
445
|
|
|
444
446
|
# wait for the device to be fully loaded.
|
|
@@ -476,48 +478,29 @@ class ZeroconfConnect:
|
|
|
476
478
|
# process results.
|
|
477
479
|
result = ZeroconfResponse(root=responseData)
|
|
478
480
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
# did we get a 202 (ERROR-LOGIN-FAILED) status? if so,
|
|
483
|
-
#
|
|
484
|
-
#
|
|
485
|
-
#
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
# wait 10 seconds, calling "getInfo" 2x every second to see what it displays.
|
|
492
|
-
# after this loop, we will call addUser one more time.
|
|
493
|
-
|
|
494
|
-
# wait for the device to be fully loaded.
|
|
495
|
-
# once this happens, the device Status code should be 101 (OK).
|
|
496
|
-
loopTotalDelay:float = 0
|
|
497
|
-
LOOP_DELAY:float = 0.50
|
|
498
|
-
LOOP_TIMEOUT:float = 15.0
|
|
499
|
-
while True:
|
|
500
|
-
|
|
501
|
-
# wait just a bit between device info queries.
|
|
502
|
-
_logsi.LogVerbose("Delaying for %s seconds before callling getInfo for Spotify Connect device id '%s'" % (LOOP_DELAY, info.DeviceId), colorValue=SIColors.Red)
|
|
503
|
-
time.sleep(LOOP_DELAY)
|
|
504
|
-
loopTotalDelay = loopTotalDelay + LOOP_DELAY
|
|
505
|
-
|
|
506
|
-
# get device information;
|
|
507
|
-
info = self.GetInformation()
|
|
508
|
-
# if info.Status == 101:
|
|
509
|
-
# _logsi.LogVerbose("Spotify Connect Device id '%s' status changed to '%s'(%s) within %f seconds of initial addUser request" % (info.DeviceId, info.Status, info.StatusString, loopTotalDelay))
|
|
510
|
-
# break
|
|
481
|
+
# trace.
|
|
482
|
+
_logsi.LogObject(SILevel.Verbose, '%s result (addUser %s)' % (apiMethodName, type(result).__name__), result, excludeNonPublic=True)
|
|
483
|
+
|
|
484
|
+
# did we get a 202 (ERROR-LOGIN-FAILED) status? if so, we will retry the addUser call
|
|
485
|
+
# a few times. this is required for devices that may be having issues contacting the
|
|
486
|
+
# Spotify backend from the Spotify Connect zeroconf service running on the device.
|
|
487
|
+
# Sonos devices seem to be the major offender for this scenario.
|
|
488
|
+
LOOP_ATTEMPTS:int = 0
|
|
489
|
+
LOOP_ATTEMPTS_MAX:int = 5
|
|
490
|
+
LOOP_DELAY:float = 0.25
|
|
491
|
+
while (result.Status == 202) and (result.StatusString == "ERROR-LOGIN-FAILED"):
|
|
511
492
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
493
|
+
# only check so many times before we give up;
|
|
494
|
+
LOOP_ATTEMPTS += 1
|
|
495
|
+
if (LOOP_ATTEMPTS > LOOP_ATTEMPTS_MAX):
|
|
496
|
+
_logsi.LogVerbose("Max attempts (%s) reached while retrying addUser request due to ERROR-LOGIN-FAILED for device id '%s'" % (LOOP_ATTEMPTS_MAX, info.DeviceId), colorValue=SIColors.Red)
|
|
497
|
+
break
|
|
516
498
|
|
|
517
|
-
#
|
|
518
|
-
_logsi.LogVerbose("
|
|
499
|
+
# wait just a bit between attempts.
|
|
500
|
+
_logsi.LogVerbose("Delaying for %s seconds before retrying addUser request due to ERROR-LOGIN-FAILED (attempt # %s)" % (LOOP_DELAY, LOOP_ATTEMPTS), colorValue=SIColors.Red)
|
|
501
|
+
time.sleep(LOOP_DELAY)
|
|
519
502
|
|
|
520
|
-
#
|
|
503
|
+
# try the addUser request again.
|
|
521
504
|
responseData = self._ConnectAddUser(
|
|
522
505
|
info,
|
|
523
506
|
username,
|
|
@@ -528,14 +511,25 @@ class ZeroconfConnect:
|
|
|
528
511
|
|
|
529
512
|
# process results.
|
|
530
513
|
result = ZeroconfResponse(root=responseData)
|
|
531
|
-
|
|
532
|
-
# trace.
|
|
533
|
-
_logsi.LogObject(SILevel.Verbose, '%s result (addUser %s)' % (apiMethodName, type(result).__name__), result, excludeNonPublic=True)
|
|
534
514
|
|
|
515
|
+
# trace.
|
|
516
|
+
_logsi.LogObject(SILevel.Verbose, '%s result (addUser %s - retry attempt #%s)' % (apiMethodName, type(result).__name__, LOOP_ATTEMPTS), result, excludeNonPublic=True, colorValue=SIColors.Red)
|
|
517
|
+
|
|
518
|
+
# get device information; we do this just to log trace data for
|
|
519
|
+
# debugging purposes; some Sonos devices will change the ActiveUser
|
|
520
|
+
# property when the user context changes (e.g. Sonos Move), while
|
|
521
|
+
# others will not change the ActiveUser property (e.g. Sonos Ikea Symfonisk).
|
|
522
|
+
info = self.GetInformation()
|
|
523
|
+
|
|
535
524
|
# if result status is not ok, then raise an exception.
|
|
536
525
|
if (result.Status != 101):
|
|
537
526
|
raise SpotifyZeroconfApiError(result.Status, result.ToString(), apiMethodName, result.StatusString, _logsi)
|
|
538
527
|
|
|
528
|
+
# get device information; we do this just to log trace data for debugging purposes.
|
|
529
|
+
# some Sonos devices will change the ActiveUser property when the user context
|
|
530
|
+
# changes (e.g. Sonos Move), while others will not (e.g. Sonos Ikea Symfonisk).
|
|
531
|
+
info = self.GetInformation()
|
|
532
|
+
|
|
539
533
|
# give spotify zeroconf api time to process the change.
|
|
540
534
|
if delay > 0:
|
|
541
535
|
_logsi.LogVerbose(TRACE_MSG_DELAY_DEVICE % delay)
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
spotifywebapipython/__init__.py,sha256=ka7F2AsT-UU7KSYKBnfgl5Trojcep5aQspLutg8D-2k,1306
|
|
2
|
-
spotifywebapipython/const.py,sha256=
|
|
2
|
+
spotifywebapipython/const.py,sha256=Ojdhql071-swTk703H9mLcEyWGZT-K9SiIhyJrShvGQ,4100
|
|
3
3
|
spotifywebapipython/saappmessages.py,sha256=mVprjpd5CdD8kYeAkLzRvMvIQPmaYtH4UCP5my3QhSk,5065
|
|
4
4
|
spotifywebapipython/sautils.py,sha256=LZF3UvxaBK35WIg1hO37nbW8j1y-M-oOxRbi1dPR39w,8746
|
|
5
5
|
spotifywebapipython/spotifyapierror.py,sha256=23_CYlxWN0BceYYCLpBpunl55vEwPr_wFf34l74xzeA,1855
|
|
6
6
|
spotifywebapipython/spotifyapimessage.py,sha256=wCnW8jYMLS3x9kjyXPgXXZqaf1HeMTTXzU8u_Dm5pfA,8447
|
|
7
7
|
spotifywebapipython/spotifyauthtoken.py,sha256=iVg2Pa5mfMqYe4qgc5H8td6JzJlaDqk4vMEhH5LmtfI,9289
|
|
8
|
-
spotifywebapipython/spotifyclient.py,sha256=
|
|
8
|
+
spotifywebapipython/spotifyclient.py,sha256=Hnun--Wl9wcj2WRvTiOwh-XQN2MA1WhvAr3OaGg9cgk,904318
|
|
9
9
|
spotifywebapipython/spotifydiscovery.py,sha256=cyysxl8PQj9yGHVbaqhSF3SStlrp-NvfGAudM-dDmg0,20290
|
|
10
10
|
spotifywebapipython/spotifymediatypes.py,sha256=hMjkxhbfTtks0_P8BKmY7qg3EmB2zhH3RT0DbEpb_2s,1628
|
|
11
11
|
spotifywebapipython/spotifytypeprefixes.py,sha256=3yfpxKF7jF694qBuo-PbKYvm70YwwdBoGj9enOpWsAg,1375
|
|
12
12
|
spotifywebapipython/spotifywebapiauthenticationerror.py,sha256=5A0MKvYo3Ypv0ZeSSfLHuFLwzoUUu044bBoUgMfNXNw,3940
|
|
13
13
|
spotifywebapipython/spotifywebapierror.py,sha256=5cga9213J_nFQ0UX4vSn3dpyinASKTRiH0wAR4nLjvs,3147
|
|
14
14
|
spotifywebapipython/spotifywebplayertoken.py,sha256=axj1j1lM7COiiZfpElkJRdnk4AmE6bAQcjKshUIz1Nk,35813
|
|
15
|
-
spotifywebapipython/docs/__init__.html,sha256=
|
|
15
|
+
spotifywebapipython/docs/__init__.html,sha256=uzEAfwl3pPKJsGfFhSMeOjk6w8y8DS14dEGXlISfe7M,194122
|
|
16
16
|
spotifywebapipython/docs/codecopy.js,sha256=ryuoZwLIL03YitjjFzn49UO5ta7-OBos6LNA3qHhFzs,3120
|
|
17
|
-
spotifywebapipython/docs/index.html,sha256
|
|
18
|
-
spotifywebapipython/docs/search.js,sha256=
|
|
17
|
+
spotifywebapipython/docs/index.html,sha256=hvHAnCH5BcywSYk4isssS-EuVRJSqwHWcW2jAcQvQ0I,48779
|
|
18
|
+
spotifywebapipython/docs/search.js,sha256=84YxUEgDnZnl4loJ9G53PP3zgzHs7E-UBaCFZT8_p6g,9167238
|
|
19
19
|
spotifywebapipython/docs/spotifywebapipython.ico,sha256=YImj39fqqSPSuB2-sMDlUYDd6YwRfQeJRtq4FjwWglg,16410
|
|
20
20
|
spotifywebapipython/docs/spotifywebapipython_OLD.ico,sha256=YIv5LjcD4bTIJQSOr8jjwbWaeB3QkElRwkTOePiGbZo,14904
|
|
21
|
-
spotifywebapipython/docs/spotifywebapipython/const.html,sha256=
|
|
22
|
-
spotifywebapipython/docs/spotifywebapipython/saappmessages.html,sha256=
|
|
23
|
-
spotifywebapipython/docs/spotifywebapipython/sautils.html,sha256
|
|
24
|
-
spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html,sha256=
|
|
25
|
-
spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html,sha256=
|
|
26
|
-
spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html,sha256=
|
|
27
|
-
spotifywebapipython/docs/spotifywebapipython/spotifyclient.html,sha256=
|
|
28
|
-
spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html,sha256=
|
|
29
|
-
spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html,sha256=
|
|
30
|
-
spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.html,sha256=
|
|
31
|
-
spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html,sha256=
|
|
32
|
-
spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html,sha256=
|
|
33
|
-
spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html,sha256=
|
|
21
|
+
spotifywebapipython/docs/spotifywebapipython/const.html,sha256=PfPWcfOwrjH17zFv2X3w4dcpv1bT0vi8FdsGcYjAUdE,60537
|
|
22
|
+
spotifywebapipython/docs/spotifywebapipython/saappmessages.html,sha256=NVjzW0YtXFFyUsTsxi1F7peLQLFVt2v65W9t7oHQpg8,62358
|
|
23
|
+
spotifywebapipython/docs/spotifywebapipython/sautils.html,sha256=-D9gnDAzLwX0szdc3778Mzgdkh0boS-FBela1OIiZSI,62031
|
|
24
|
+
spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html,sha256=KwxdaqaLqY1iNtSWXiCgS5su9-TpDTuLhmYhrh85FOs,48054
|
|
25
|
+
spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html,sha256=uqgTHvBb_DPjzP5Gfu3mwMcVSRK3E9ibbuVd0w3YUeA,59210
|
|
26
|
+
spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html,sha256=hBYI7v6HcnWTTWdEoaTAkfudj_3zt3-JXUqyjk-TbbY,59256
|
|
27
|
+
spotifywebapipython/docs/spotifywebapipython/spotifyclient.html,sha256=qmRfRqyPzab9cqQUEtZnPVklJqcWan0rxu2TT2llyFE,1667821
|
|
28
|
+
spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html,sha256=00zOIv7Z1EC6TmFdD4gjc9yrbreXm4j_d2tLHHHAbVw,57662
|
|
29
|
+
spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html,sha256=wSylTgIpoQnwm7mvAFJk36DCOhYALRY5-oNPeINur9M,51532
|
|
30
|
+
spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.html,sha256=8u41ykptgHdSRQZUqt1yE8O55N1_1YkrOtt0hQJQokk,52401
|
|
31
|
+
spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html,sha256=n-5940XCCnMr-1U_vhux3NbQnElDVMBY1fcU9h61CHw,52174
|
|
32
|
+
spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html,sha256=1w52609Ve2T_Q_zDQJxJXsd_UFUO57wunV5kWnmR7-o,50592
|
|
33
|
+
spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html,sha256=1x4Tk_IrcfODApu-FzCU5Ydtg-GyGA9TG0vYhdi_L1c,62204
|
|
34
34
|
spotifywebapipython/models/__init__.py,sha256=RwRQhUX-6EUs8XvStVFpR8EPwoqIAz9K6ref-28qHKI,4423
|
|
35
35
|
spotifywebapipython/models/album.py,sha256=U3Pdw0-EL33LdkeiN31fjZ23rlLk6DNGV8jRmZU7EyQ,5170
|
|
36
36
|
spotifywebapipython/models/albumpagesaved.py,sha256=SBYMhkh5ZsMrRAXl-cm9zsxMDh8gO190ENq6Py2TyGY,2417
|
|
@@ -107,7 +107,7 @@ spotifywebapipython/models/userprofilesimplified.py,sha256=qd1CVNwlt7J-M4tmUVaCQ
|
|
|
107
107
|
spotifywebapipython/models/zeroconfdiscoveryresult.py,sha256=XID2qmaK2WTGJoLTQ54aQjfutLJMLgJ7A1ATwAp06kY,20250
|
|
108
108
|
spotifywebapipython/models/zeroconfproperty.py,sha256=sXGUqbHhFMutCNKFJwJKbNbbQAnBnR7Ob5wNDSePxZk,2141
|
|
109
109
|
spotifywebapipython/oauthcli/__init__.py,sha256=K37XTxYAKT0n8otCNzWbjgJ10fAPN4WL6seEpwvWyo4,168
|
|
110
|
-
spotifywebapipython/oauthcli/authclient.py,sha256=
|
|
110
|
+
spotifywebapipython/oauthcli/authclient.py,sha256=qGKa4FLBHHZQyP5ho1sIM_mNmyshQd720YwKcUFQJAw,56207
|
|
111
111
|
spotifywebapipython/spotifyconnect/__init__.py,sha256=9Xl5KiJFvWLbsdb4YQ0xmF67i36ybpXCCXrWeNsKEvc,1108
|
|
112
112
|
spotifywebapipython/spotifyconnect/spotifyconnectdeviceeventargs.py,sha256=35hKa0FAaPgy7W8D6MFXmga667pjwXITo8jSj1TDfE8,1988
|
|
113
113
|
spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py,sha256=QXNpJSqUGuOYxCzvDH63Ka9L9Yo7Bb5iVBRtDhc4ILE,153923
|
|
@@ -132,13 +132,13 @@ spotifywebapipython/zeroconfapi/credentials.py,sha256=MIXqZvFNDjoICpZGNXPveHNl9G
|
|
|
132
132
|
spotifywebapipython/zeroconfapi/cryptodiffiehellman.py,sha256=k-nMR68GtzODYsQrwCpvFE2XNxv-XUFbMemplldtwp4,3340
|
|
133
133
|
spotifywebapipython/zeroconfapi/helpers.py,sha256=9lJFOuKYrk-e7SbU94WmFv5oiBq4k5gMS8wE1it4Wbc,1429
|
|
134
134
|
spotifywebapipython/zeroconfapi/spotifyzeroconfapierror.py,sha256=rTwIrr1qV0UiQS_zBufboyZ3A3yGrdCsTAOiVA5dvzY,3031
|
|
135
|
-
spotifywebapipython/zeroconfapi/zeroconfconnect.py,sha256=
|
|
135
|
+
spotifywebapipython/zeroconfapi/zeroconfconnect.py,sha256=DDuVljjg_SF_YJWWQjmCSG-6-93YBSTCLhjr77DI5xI,70266
|
|
136
136
|
spotifywebapipython/zeroconfapi/zeroconfgetinfo.py,sha256=APayso_F7lCsdzzrkescgd-nKukUah3Kjfs-5F2tnvU,21415
|
|
137
137
|
spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py,sha256=FZJM23HIPJSfhXIC3-EuS1XhawheoG5maSp7__k4yBo,2932
|
|
138
138
|
spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py,sha256=c5uk8ljsIuBK3w2jahHKQuoWvm245LOjUBitetXx5Mo,2347
|
|
139
139
|
spotifywebapipython/zeroconfapi/zeroconfresponse.py,sha256=mAPIDj5MG53x8peiScrp7OJblwy_o_Sto4wqE0rGujU,6445
|
|
140
|
-
spotifywebapipython-1.0.
|
|
141
|
-
spotifywebapipython-1.0.
|
|
142
|
-
spotifywebapipython-1.0.
|
|
143
|
-
spotifywebapipython-1.0.
|
|
144
|
-
spotifywebapipython-1.0.
|
|
140
|
+
spotifywebapipython-1.0.282.dist-info/LICENSE,sha256=KGcc9g0zwqNLcWnSn_ezv1UtKyhMENFhvtixpxUPNsE,1177
|
|
141
|
+
spotifywebapipython-1.0.282.dist-info/METADATA,sha256=xsOeXo3mR4BQITUaJnpy2XugbwOS_QTa0O-mhSBcshY,11644
|
|
142
|
+
spotifywebapipython-1.0.282.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
143
|
+
spotifywebapipython-1.0.282.dist-info/top_level.txt,sha256=jTBLFlijKTesYh2dteAz4vb17qjaqWKeDjpnnwTcrjs,20
|
|
144
|
+
spotifywebapipython-1.0.282.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{spotifywebapipython-1.0.280.dist-info → spotifywebapipython-1.0.282.dist-info}/top_level.txt
RENAMED
|
File without changes
|