spotifywebapiPython 1.0.84__py3-none-any.whl → 1.0.86__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 (22) hide show
  1. {spotifywebapiPython-1.0.84.dist-info → spotifywebapiPython-1.0.86.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.84.dist-info → spotifywebapiPython-1.0.86.dist-info}/RECORD +22 -22
  3. spotifywebapipython/const.py +6 -1
  4. spotifywebapipython/docs/__init__.html +19 -2
  5. spotifywebapipython/docs/index.html +2 -2
  6. spotifywebapipython/docs/search.js +1 -1
  7. spotifywebapipython/docs/spotifywebapiPython/const.html +20 -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 +128 -42
  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/oauthcli/authclient.py +22 -5
  18. spotifywebapipython/spotifyclient.py +196 -27
  19. spotifywebapipython/zeroconfapi/zeroconfconnect.py +20 -1
  20. {spotifywebapiPython-1.0.84.dist-info → spotifywebapiPython-1.0.86.dist-info}/LICENSE +0 -0
  21. {spotifywebapiPython-1.0.84.dist-info → spotifywebapiPython-1.0.86.dist-info}/WHEEL +0 -0
  22. {spotifywebapiPython-1.0.84.dist-info → spotifywebapiPython-1.0.86.dist-info}/top_level.txt +0 -0
@@ -21,6 +21,7 @@ from ..const import (
21
21
  SPOTIFY_API_AUTHORIZE_URL,
22
22
  SPOTIFY_API_TOKEN_URL,
23
23
  SPOTIFY_DESKTOP_APP_CLIENT_ID,
24
+ SPOTIFYWEBAPIPYTHON_TOKEN_CACHE_FILE,
24
25
  TRACE_METHOD_RESULT,
25
26
  TRACE_MSG_DELAY_DEVICE,
26
27
  )
@@ -61,6 +62,7 @@ class ZeroconfConnect:
61
62
  version:str=None,
62
63
  useSSL:bool=False,
63
64
  tokenStorageDir:str=None,
65
+ tokenStorageFile:str=None,
64
66
  tokenAuthInBrowser:bool=False,
65
67
  ) -> None:
66
68
  """
@@ -83,10 +85,13 @@ class ZeroconfConnect:
83
85
  otherwise, False to utilize HTTP.
84
86
  Default is False (HTTP).
85
87
  tokenStorageDir (str):
86
- The directory path that will contain the `tokens.json` cache file.
88
+ The directory path that will contain the Token Cache file.
87
89
  This is used for Spotify Connect devices that utilize the `authorization_code` token type.
88
90
  A null value will default to the platform specific storage location:
89
91
  Example for Windows OS = `C:\ProgramData\SpotifyWebApiPython`
92
+ tokenStorageFile (str):
93
+ The filename and extension of the Token Cache file.
94
+ Default is `SpotifyWebApiPython_tokens.json`.
90
95
  tokenAuthInBrowser (bool):
91
96
  True to allow authorization access token to be authorized if necessary via an
92
97
  interactive browser; otherwise, False.
@@ -103,11 +108,16 @@ class ZeroconfConnect:
103
108
  if (version is None) or (not isinstance(version,str)):
104
109
  version = ZeroconfConnect.SPOTIFY_CONNECT_CLIENT_VERSION_DEFAULT
105
110
 
111
+ # verify token storage filename was specified.
112
+ if tokenStorageFile is None:
113
+ tokenStorageFile = SPOTIFYWEBAPIPYTHON_TOKEN_CACHE_FILE
114
+
106
115
  # initialize storage.
107
116
  self._CPath:str = cpath
108
117
  self._HostIpPort:int = hostIpPort
109
118
  self._HostIpAddress:str = hostIpAddress
110
119
  self._TokenStorageDir:str = tokenStorageDir
120
+ self._TokenStorageFile:str = tokenStorageFile
111
121
  self._TokenAuthInBrowser:str = tokenAuthInBrowser
112
122
  self._UseSSL:bool = useSSL
113
123
  self._Version:str = version
@@ -159,6 +169,14 @@ class ZeroconfConnect:
159
169
  return self._TokenStorageDir
160
170
 
161
171
 
172
+ @property
173
+ def TokenStorageFile(self) -> str:
174
+ """
175
+ The filename and extension of the authorization token cache file.
176
+ """
177
+ return self._TokenStorageFile
178
+
179
+
162
180
  @property
163
181
  def Uri(self) -> str:
164
182
  """
@@ -677,6 +695,7 @@ class ZeroconfConnect:
677
695
  scope=SPOTIFY_SCOPES,
678
696
  clientId=SPOTIFY_DESKTOP_APP_CLIENT_ID,
679
697
  tokenStorageDir=self.TokenStorageDir,
698
+ tokenStorageFile=self.TokenStorageFile,
680
699
  tokenProviderId='SpotifyWebApiAuthCodePkce',
681
700
  tokenProfileId=loginId,
682
701
  )