spotifywebapiPython 1.0.105__py3-none-any.whl → 1.0.107__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 (26) hide show
  1. {spotifywebapiPython-1.0.105.dist-info → spotifywebapiPython-1.0.107.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.105.dist-info → spotifywebapiPython-1.0.107.dist-info}/RECORD +26 -26
  3. spotifywebapipython/const.py +1 -1
  4. spotifywebapipython/docs/__init__.html +16 -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 +16 -11
  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/models/playerplaystate.py +1 -1
  18. spotifywebapipython/models/playlist.py +2 -2
  19. spotifywebapipython/models/spotifyconnectdevices.py +14 -0
  20. spotifywebapipython/oauthcli/authclient.py +7 -7
  21. spotifywebapipython/spotifyclient.py +36 -29
  22. spotifywebapipython/zeroconfapi/zeroconfconnect.py +1 -1
  23. spotifywebapipython/zeroconfapi/zeroconfgetinfo.py +24 -0
  24. {spotifywebapiPython-1.0.105.dist-info → spotifywebapiPython-1.0.107.dist-info}/LICENSE +0 -0
  25. {spotifywebapiPython-1.0.105.dist-info → spotifywebapiPython-1.0.107.dist-info}/WHEEL +0 -0
  26. {spotifywebapiPython-1.0.105.dist-info → spotifywebapiPython-1.0.107.dist-info}/top_level.txt +0 -0
@@ -95,7 +95,7 @@ class SpotifyClient:
95
95
  tokenStorageDir (str):
96
96
  The directory path that will contain the authorization Token Cache file.
97
97
  A null value will default to the platform specific storage location:
98
- Example for Windows OS = `C:\ProgramData\SpotifyWebApiPython`
98
+ Example for Windows OS = `C:\\ProgramData\\SpotifyWebApiPython`
99
99
  tokenStorageFile (str):
100
100
  The filename and extension of the authorization Token Cache file.
101
101
  Default is `SpotifyWebApiPython_tokens.json`.
@@ -1622,12 +1622,13 @@ class SpotifyClient:
1622
1622
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
1623
1623
 
1624
1624
 
1625
- def CheckPlaylistFollowers(self,
1626
- playlistId:str,
1627
- userIds:str
1628
- ) -> dict:
1625
+ def CheckPlaylistFollowers(
1626
+ self,
1627
+ playlistId:str,
1628
+ userIds:str=None,
1629
+ ) -> dict:
1629
1630
  """
1630
- Check to see if one or more Spotify users are following a specified playlist.
1631
+ Check to see if the current user is following a specified playlist.
1631
1632
 
1632
1633
  Args:
1633
1634
  playlistId (str):
@@ -1637,9 +1638,10 @@ class SpotifyClient:
1637
1638
  A comma-separated list of Spotify User ID's to check.
1638
1639
  Maximum: 5 ID's.
1639
1640
  Example: `1kWUud3vY5ij5r62zxpTRy,2takcwOaAZWiXQijPHIx7B`
1641
+ Deprecated - A single item list containing current user's Spotify Username; Maximum of 1 id.
1640
1642
 
1641
1643
  Returns:
1642
- A dictionary of the userIds, along with a boolean status for each that indicates
1644
+ Array of boolean, containing a single boolean status that indicates
1643
1645
  if the user follows the playlist (True) or not (False).
1644
1646
 
1645
1647
  Raises:
@@ -1648,6 +1650,11 @@ class SpotifyClient:
1648
1650
  and the response contains error information.
1649
1651
  SpotifApiError:
1650
1652
  If the method fails for any other reason.
1653
+
1654
+ As of (at least) 2024/10/07, Spotify has deprecated the userId's argument;
1655
+ only current user can be tested. Any other id's specified on this argument will
1656
+ generate a `400 Bad Request` error.
1657
+
1651
1658
 
1652
1659
  <details>
1653
1660
  <summary>Sample Code</summary>
@@ -1667,6 +1674,10 @@ class SpotifyClient:
1667
1674
  apiMethodParms.AppendKeyValue("playlistId", playlistId)
1668
1675
  apiMethodParms.AppendKeyValue("userIds", userIds)
1669
1676
  _logsi.LogMethodParmList(SILevel.Verbose, "Check to see if users are following a playlist", apiMethodParms)
1677
+
1678
+ # validations.
1679
+ if (userIds is None):
1680
+ userIds = self.UserProfile.Id
1670
1681
 
1671
1682
  # build spotify web api request parameters.
1672
1683
  urlParms:dict = \
@@ -4265,7 +4276,7 @@ class SpotifyClient:
4265
4276
  Default: None (disabled)
4266
4277
 
4267
4278
  Returns:
4268
- A `ChapterPageSimplified` object that contains simplified track information for the audiobookId.
4279
+ A `ChapterPageSimplified` object that contains simplified chapter information for the audiobook Id.
4269
4280
 
4270
4281
  Raises:
4271
4282
  SpotifyWebApiError:
@@ -7653,7 +7664,7 @@ class SpotifyClient:
7653
7664
  Default: None (disabled)
7654
7665
 
7655
7666
  Returns:
7656
- A `Playlist` object that contains the playlist details.
7667
+ A `PlaylistPage` object that contains the playlist items.
7657
7668
 
7658
7669
  Raises:
7659
7670
  SpotifyWebApiError:
@@ -12627,9 +12638,10 @@ class SpotifyClient:
12627
12638
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
12628
12639
 
12629
12640
 
12630
- def RemovePlaylist(self,
12631
- playlistId:str,
12632
- ) -> None:
12641
+ def RemovePlaylist(
12642
+ self,
12643
+ playlistId:str=None,
12644
+ ) -> None:
12633
12645
  """
12634
12646
  Remove a user's playlist (calls the `UnfollowPlaylist` method).
12635
12647
 
@@ -12638,9 +12650,8 @@ class SpotifyClient:
12638
12650
  Args:
12639
12651
 
12640
12652
  playlistId (str):
12641
- The Spotify ID of the playlist.
12642
- Example: `5AC9ZXA7nJ7oGWO911FuDG`
12643
-
12653
+ The Spotify ID of the playlist (e.g. `5AC9ZXA7nJ7oGWO911FuDG`).
12654
+ If null, the currently playing playlist uri id value is used.
12644
12655
  Raises:
12645
12656
  SpotifyWebApiError:
12646
12657
  If the Spotify Web API request was for a non-authorization service
@@ -12860,22 +12871,20 @@ class SpotifyClient:
12860
12871
  else:
12861
12872
  raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
12862
12873
 
12863
- # build a list of all item id's.
12864
12874
  # remove any leading / trailing spaces in case user put a space between the items.
12865
- arrIds:list[str] = ids.split(',')
12866
- for idx in range(0, len(arrIds)):
12867
- arrIds[idx] = arrIds[idx].strip()
12875
+ if (ids is not None):
12876
+ ids = ids.replace(" ","")
12868
12877
 
12869
12878
  # build spotify web api request parameters.
12870
- reqData:dict = \
12879
+ urlParms:dict = \
12871
12880
  {
12872
- 'ids': arrIds
12881
+ 'ids': ids
12873
12882
  }
12874
12883
 
12875
12884
  # execute spotify web api request.
12876
12885
  msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/me/shows')
12877
12886
  msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
12878
- msg.RequestJson = reqData
12887
+ msg.UrlParameters = urlParms
12879
12888
  self.MakeRequest('DELETE', msg)
12880
12889
 
12881
12890
  # process results.
@@ -13511,22 +13520,20 @@ class SpotifyClient:
13511
13520
  else:
13512
13521
  raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
13513
13522
 
13514
- # build a list of all item id's.
13515
13523
  # remove any leading / trailing spaces in case user put a space between the items.
13516
- arrIds:list[str] = ids.split(',')
13517
- for idx in range(0, len(arrIds)):
13518
- arrIds[idx] = arrIds[idx].strip()
13524
+ if (ids is not None):
13525
+ ids = ids.replace(" ","")
13519
13526
 
13520
13527
  # build spotify web api request parameters.
13521
- reqData:dict = \
13528
+ urlParms:dict = \
13522
13529
  {
13523
- 'ids': arrIds
13530
+ 'ids': ids
13524
13531
  }
13525
13532
 
13526
13533
  # execute spotify web api request.
13527
13534
  msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/me/shows')
13528
13535
  msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
13529
- msg.RequestJson = reqData
13536
+ msg.UrlParameters = urlParms
13530
13537
  self.MakeRequest('PUT', msg)
13531
13538
 
13532
13539
  # process results.
@@ -89,7 +89,7 @@ class ZeroconfConnect:
89
89
  The directory path that will contain the Token Cache file.
90
90
  This is used for Spotify Connect devices that utilize the `authorization_code` token type.
91
91
  A null value will default to the platform specific storage location:
92
- Example for Windows OS = `C:\ProgramData\SpotifyWebApiPython`
92
+ Example for Windows OS = `C:\\ProgramData\\SpotifyWebApiPython`
93
93
  tokenStorageFile (str):
94
94
  The filename and extension of the Token Cache file.
95
95
  Default is `SpotifyWebApiPython_tokens.json`.
@@ -167,6 +167,14 @@ class ZeroconfGetInfo(ZeroconfResponse):
167
167
  """
168
168
  return self._BrandDisplayName
169
169
 
170
+ @BrandDisplayName.setter
171
+ def BrandDisplayName(self, value:str):
172
+ """
173
+ Sets the BrandDisplayName property value.
174
+ """
175
+ if isinstance(value, str):
176
+ self._BrandDisplayName = value
177
+
170
178
 
171
179
  @property
172
180
  def ClientId(self) -> str:
@@ -305,6 +313,14 @@ class ZeroconfGetInfo(ZeroconfResponse):
305
313
  """
306
314
  return self._ModelDisplayName
307
315
 
316
+ @ModelDisplayName.setter
317
+ def ModelDisplayName(self, value:str):
318
+ """
319
+ Sets the ModelDisplayName property value.
320
+ """
321
+ if isinstance(value, str):
322
+ self._ModelDisplayName = value
323
+
308
324
 
309
325
  @property
310
326
  def ProductId(self) -> str:
@@ -313,6 +329,14 @@ class ZeroconfGetInfo(ZeroconfResponse):
313
329
  """
314
330
  return self._ProductId
315
331
 
332
+ @ProductId.setter
333
+ def ProductId(self, value:str):
334
+ """
335
+ Sets the ProductId property value.
336
+ """
337
+ if isinstance(value, str):
338
+ self._ProductId = value
339
+
316
340
 
317
341
  @property
318
342
  def PublicKey(self) -> str: