spotifywebapiPython 1.0.82__py3-none-any.whl → 1.0.84__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.82.dist-info → spotifywebapiPython-1.0.84.dist-info}/METADATA +1 -1
- {spotifywebapiPython-1.0.82.dist-info → spotifywebapiPython-1.0.84.dist-info}/RECORD +22 -22
- 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 +5 -4
- spotifywebapipython/docs/spotifywebapiPython/spotifydiscovery.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifywebapiauthenticationerror.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifywebapierror.html +2 -2
- spotifywebapipython/oauthcli/authclient.py +84 -0
- spotifywebapipython/spotifyclient.py +24 -5
- spotifywebapipython/zeroconfapi/zeroconfconnect.py +14 -7
- {spotifywebapiPython-1.0.82.dist-info → spotifywebapiPython-1.0.84.dist-info}/LICENSE +0 -0
- {spotifywebapiPython-1.0.82.dist-info → spotifywebapiPython-1.0.84.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.82.dist-info → spotifywebapiPython-1.0.84.dist-info}/top_level.txt +0 -0
|
@@ -380,7 +380,7 @@ class ZeroconfConnect:
|
|
|
380
380
|
apiMethodParms.AppendKeyValue("username", username)
|
|
381
381
|
apiMethodParms.AppendKeyValue("password (with mask)", passwordMaskString(password))
|
|
382
382
|
apiMethodParms.AppendKeyValue("delay", delay)
|
|
383
|
-
_logsi.LogMethodParmList(SILevel.Verbose, "Connecting device to Spotify Connect
|
|
383
|
+
_logsi.LogMethodParmList(SILevel.Verbose, "Connecting device to Spotify Connect (ip=%s)" % self._HostIpAddress, apiMethodParms)
|
|
384
384
|
|
|
385
385
|
# validations.
|
|
386
386
|
if (username is None) or (not isinstance(username,str)):
|
|
@@ -505,11 +505,16 @@ class ZeroconfConnect:
|
|
|
505
505
|
|
|
506
506
|
# trace.
|
|
507
507
|
apiMethodParms = _logsi.EnterMethodParmList(SILevel.Debug, apiMethodName)
|
|
508
|
+
apiMethodParms.AppendKeyValue("username", username)
|
|
509
|
+
apiMethodParms.AppendKeyValue("password (with mask)", passwordMaskString(password))
|
|
510
|
+
apiMethodParms.AppendKeyValue("loginId", loginId)
|
|
508
511
|
apiMethodParms.AppendKeyValue("info.Availability", info.Availability)
|
|
509
512
|
apiMethodParms.AppendKeyValue("info.PublicKey", info.PublicKey)
|
|
510
513
|
apiMethodParms.AppendKeyValue("info.DeviceId", info.DeviceId)
|
|
511
514
|
apiMethodParms.AppendKeyValue("info.RemoteName", info.RemoteName)
|
|
512
515
|
apiMethodParms.AppendKeyValue("info.TokenType", info.TokenType)
|
|
516
|
+
apiMethodParms.AppendKeyValue("info.BrandDisplayName", info.BrandDisplayName)
|
|
517
|
+
apiMethodParms.AppendKeyValue("info.ModelDisplayName", info.ModelDisplayName)
|
|
513
518
|
_logsi.LogMethodParmList(SILevel.Verbose, "Issuing Spotify Connect Zeroconf addUser request (ip=%s)" % self._HostIpAddress, apiMethodParms)
|
|
514
519
|
|
|
515
520
|
# set request endpoint.
|
|
@@ -518,10 +523,7 @@ class ZeroconfConnect:
|
|
|
518
523
|
# set request headers.
|
|
519
524
|
reqHeaders:dict = {
|
|
520
525
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
521
|
-
|
|
522
|
-
'Connection': 'keep-alive',
|
|
523
|
-
'Keep-Alive': '0',
|
|
524
|
-
'Accept-Encoding': 'gzip',
|
|
526
|
+
'Connection': 'close'
|
|
525
527
|
}
|
|
526
528
|
|
|
527
529
|
# create credentials and builder objects.
|
|
@@ -542,6 +544,9 @@ class ZeroconfConnect:
|
|
|
542
544
|
# special processing for tokenType "authorization_code":
|
|
543
545
|
if info.TokenType == 'authorization_code':
|
|
544
546
|
|
|
547
|
+
# trace.
|
|
548
|
+
_logsi.LogVerbose("Spotify Connect token type is '%s' - using Spotify Desktop Client OAuth2 token to connect: '%s' (ip=%s)" % (info.TokenType, info.RemoteName, self._HostIpAddress))
|
|
549
|
+
|
|
545
550
|
# set defaults used by token type "authorization_code".
|
|
546
551
|
# - set the clientKey value to null, as it is not used to encrypt / decrypt anything.
|
|
547
552
|
# - include origin device information in the addUser request.
|
|
@@ -555,6 +560,9 @@ class ZeroconfConnect:
|
|
|
555
560
|
|
|
556
561
|
else:
|
|
557
562
|
|
|
563
|
+
# trace.
|
|
564
|
+
_logsi.LogVerbose("Spotify Connect token type is '%s' - using Spotify username and password to connect: '%s' (ip=%s)" % (info.TokenType, info.RemoteName, self._HostIpAddress))
|
|
565
|
+
|
|
558
566
|
# set defaults used by this token type:
|
|
559
567
|
# - clientKey should be the getInfo response PublicKey (base64 encoded).
|
|
560
568
|
# - exclude origin device information from the addUser request.
|
|
@@ -653,7 +661,6 @@ class ZeroconfConnect:
|
|
|
653
661
|
redirectUriPort:str = 4381
|
|
654
662
|
redirectUriPath:str = '/login'
|
|
655
663
|
authorizationType:str = 'Authorization Code PKCE'
|
|
656
|
-
tokenProfileId:str = loginId
|
|
657
664
|
|
|
658
665
|
# Spotify Desktop App scopes requested for Spotify Connect (streaming only as of 2024/08/13)
|
|
659
666
|
SPOTIFY_SCOPES:list = \
|
|
@@ -671,7 +678,7 @@ class ZeroconfConnect:
|
|
|
671
678
|
clientId=SPOTIFY_DESKTOP_APP_CLIENT_ID,
|
|
672
679
|
tokenStorageDir=self.TokenStorageDir,
|
|
673
680
|
tokenProviderId='SpotifyWebApiAuthCodePkce',
|
|
674
|
-
tokenProfileId=
|
|
681
|
+
tokenProfileId=loginId,
|
|
675
682
|
)
|
|
676
683
|
|
|
677
684
|
# raise an exception if the authorization token is not present, or the scope has changed.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|