spotifywebapiPython 1.0.121__py3-none-any.whl → 1.0.123__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.121.dist-info → spotifywebapiPython-1.0.123.dist-info}/METADATA +1 -1
- {spotifywebapiPython-1.0.121.dist-info → spotifywebapiPython-1.0.123.dist-info}/RECORD +23 -23
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +17 -3
- spotifywebapipython/docs/index.html +3 -3
- spotifywebapipython/docs/search.js +1 -1
- spotifywebapipython/docs/spotifywebapipython/const.html +4 -4
- spotifywebapipython/docs/spotifywebapipython/saappmessages.html +21 -3
- spotifywebapipython/docs/spotifywebapipython/sautils.html +3 -3
- spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +3 -3
- spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +3 -3
- spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +3 -3
- spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +55 -12
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +3 -3
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +3 -3
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +3 -3
- spotifywebapipython/models/tracksimplified.py +8 -1
- spotifywebapipython/saappmessages.py +5 -1
- spotifywebapipython/spotifyclient.py +171 -16
- spotifywebapipython/zeroconfapi/zeroconfresponse.py +1 -1
- {spotifywebapiPython-1.0.121.dist-info → spotifywebapiPython-1.0.123.dist-info}/LICENSE +0 -0
- {spotifywebapiPython-1.0.121.dist-info → spotifywebapiPython-1.0.123.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.121.dist-info → spotifywebapiPython-1.0.123.dist-info}/top_level.txt +0 -0
|
@@ -2333,7 +2333,13 @@ class SpotifyClient:
|
|
|
2333
2333
|
apiMethodParms.AppendKeyValue("collaborative", collaborative)
|
|
2334
2334
|
apiMethodParms.AppendKeyValue("imagePath", imagePath)
|
|
2335
2335
|
_logsi.LogMethodParmList(SILevel.Verbose, "Create an empty playlist for a user", apiMethodParms)
|
|
2336
|
-
|
|
2336
|
+
|
|
2337
|
+
# validations.
|
|
2338
|
+
if (public is None):
|
|
2339
|
+
public = True
|
|
2340
|
+
if (collaborative is None):
|
|
2341
|
+
collaborative = False
|
|
2342
|
+
|
|
2337
2343
|
# if userId is not supplied, then use profile value.
|
|
2338
2344
|
if userId is None or len(userId.strip()) == 0:
|
|
2339
2345
|
userId = self.UserProfile.Id
|
|
@@ -2489,7 +2495,7 @@ class SpotifyClient:
|
|
|
2489
2495
|
public (bool):
|
|
2490
2496
|
If true the playlist will be included in user's public playlists, if false it
|
|
2491
2497
|
will remain private.
|
|
2492
|
-
Default
|
|
2498
|
+
Default is True.
|
|
2493
2499
|
|
|
2494
2500
|
Raises:
|
|
2495
2501
|
SpotifyWebApiError:
|
|
@@ -2515,6 +2521,10 @@ class SpotifyClient:
|
|
|
2515
2521
|
apiMethodParms.AppendKeyValue("playlistId", playlistId)
|
|
2516
2522
|
apiMethodParms.AppendKeyValue("public", public)
|
|
2517
2523
|
_logsi.LogMethodParmList(SILevel.Verbose, "Add the current user as a follower of a playlist", apiMethodParms)
|
|
2524
|
+
|
|
2525
|
+
# validations.
|
|
2526
|
+
if (public is None):
|
|
2527
|
+
public = True
|
|
2518
2528
|
|
|
2519
2529
|
# if playlistId not specified, then return currently playing playlist id value.
|
|
2520
2530
|
if (playlistId is None) or (len(playlistId.strip()) == 0):
|
|
@@ -3943,6 +3953,13 @@ class SpotifyClient:
|
|
|
3943
3953
|
sortResult:bool=True,
|
|
3944
3954
|
) -> list[Artist]:
|
|
3945
3955
|
"""
|
|
3956
|
+
<span class="deprecated">
|
|
3957
|
+
DEPRECATED - api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
3958
|
+
More information about the deprecated functionality can be found on the
|
|
3959
|
+
<a href="https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api" target="_blank">Spotify Developer Forum Blog</a>
|
|
3960
|
+
page.
|
|
3961
|
+
</span>
|
|
3962
|
+
|
|
3946
3963
|
Get Spotify catalog information about artists similar to a given artist.
|
|
3947
3964
|
Similarity is based on analysis of the Spotify community's listening history.
|
|
3948
3965
|
|
|
@@ -3985,6 +4002,9 @@ class SpotifyClient:
|
|
|
3985
4002
|
apiMethodParms.AppendKeyValue("artistId", artistId)
|
|
3986
4003
|
apiMethodParms.AppendKeyValue("sortResult", sortResult)
|
|
3987
4004
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information about artists similar to a given artist", apiMethodParms)
|
|
4005
|
+
|
|
4006
|
+
# api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
4007
|
+
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT % apiMethodName)
|
|
3988
4008
|
|
|
3989
4009
|
# validations.
|
|
3990
4010
|
if sortResult is None:
|
|
@@ -4986,6 +5006,10 @@ class SpotifyClient:
|
|
|
4986
5006
|
apiMethodParms.AppendKeyValue("locale", locale)
|
|
4987
5007
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get a single category used to tag items in Spotify", apiMethodParms)
|
|
4988
5008
|
|
|
5009
|
+
# validations.
|
|
5010
|
+
if (refresh is None):
|
|
5011
|
+
refresh = True
|
|
5012
|
+
|
|
4989
5013
|
# can we use a cached value?
|
|
4990
5014
|
cacheKey:str = "GetBrowseCategorys"
|
|
4991
5015
|
if (not refresh) and (cacheKey in self._ConfigurationCache):
|
|
@@ -5277,6 +5301,10 @@ class SpotifyClient:
|
|
|
5277
5301
|
apiMethodParms.AppendKeyValue("refresh", refresh)
|
|
5278
5302
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get a sorted list of ALL browse categories", apiMethodParms)
|
|
5279
5303
|
|
|
5304
|
+
# validations.
|
|
5305
|
+
if (refresh is None):
|
|
5306
|
+
refresh = True
|
|
5307
|
+
|
|
5280
5308
|
# can we use the cached value?
|
|
5281
5309
|
if (not refresh) and (apiMethodName in self._ConfigurationCache):
|
|
5282
5310
|
|
|
@@ -5324,6 +5352,13 @@ class SpotifyClient:
|
|
|
5324
5352
|
sortResult:bool=True,
|
|
5325
5353
|
) -> Tuple[PlaylistPageSimplified, str]:
|
|
5326
5354
|
"""
|
|
5355
|
+
<span class="deprecated">
|
|
5356
|
+
DEPRECATED - api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
5357
|
+
More information about the deprecated functionality can be found on the
|
|
5358
|
+
<a href="https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api" target="_blank">Spotify Developer Forum Blog</a>
|
|
5359
|
+
page.
|
|
5360
|
+
</span>
|
|
5361
|
+
|
|
5327
5362
|
Get a list of Spotify playlists tagged with a particular category.
|
|
5328
5363
|
|
|
5329
5364
|
Args:
|
|
@@ -5405,6 +5440,9 @@ class SpotifyClient:
|
|
|
5405
5440
|
apiMethodParms.AppendKeyValue("sortResult", sortResult)
|
|
5406
5441
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get a list of Spotify playlists tagged with a particular category", apiMethodParms)
|
|
5407
5442
|
|
|
5443
|
+
# api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
5444
|
+
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT % apiMethodName)
|
|
5445
|
+
|
|
5408
5446
|
# validations.
|
|
5409
5447
|
if limit is None:
|
|
5410
5448
|
limit = 20
|
|
@@ -5564,6 +5602,10 @@ class SpotifyClient:
|
|
|
5564
5602
|
apiMethodParms.AppendKeyValue("ignoreResponseErrors", ignoreResponseErrors)
|
|
5565
5603
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information for a single audiobook chapter", apiMethodParms)
|
|
5566
5604
|
|
|
5605
|
+
# validations.
|
|
5606
|
+
if (ignoreResponseErrors is None):
|
|
5607
|
+
ignoreResponseErrors = False
|
|
5608
|
+
|
|
5567
5609
|
# ensure market was either supplied or implied; default if neither.
|
|
5568
5610
|
market = self._ValidateMarket(market)
|
|
5569
5611
|
|
|
@@ -6071,6 +6113,13 @@ class SpotifyClient:
|
|
|
6071
6113
|
sortResult:bool=True,
|
|
6072
6114
|
) -> Tuple[PlaylistPageSimplified, str]:
|
|
6073
6115
|
"""
|
|
6116
|
+
<span class="deprecated">
|
|
6117
|
+
DEPRECATED - api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
6118
|
+
More information about the deprecated functionality can be found on the
|
|
6119
|
+
<a href="https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api" target="_blank">Spotify Developer Forum Blog</a>
|
|
6120
|
+
page.
|
|
6121
|
+
</span>
|
|
6122
|
+
|
|
6074
6123
|
Get a list of Spotify featured playlists (shown, for example, on a Spotify player's 'Browse' tab).
|
|
6075
6124
|
|
|
6076
6125
|
Args:
|
|
@@ -6159,6 +6208,9 @@ class SpotifyClient:
|
|
|
6159
6208
|
apiMethodParms.AppendKeyValue("sortResult", sortResult)
|
|
6160
6209
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get a list of Spotify featured playlists", apiMethodParms)
|
|
6161
6210
|
|
|
6211
|
+
# api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
6212
|
+
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT % apiMethodName)
|
|
6213
|
+
|
|
6162
6214
|
# validations.
|
|
6163
6215
|
if limit is None:
|
|
6164
6216
|
limit = 20
|
|
@@ -6259,6 +6311,13 @@ class SpotifyClient:
|
|
|
6259
6311
|
refresh:bool=True
|
|
6260
6312
|
) -> list[str]:
|
|
6261
6313
|
"""
|
|
6314
|
+
<span class="deprecated">
|
|
6315
|
+
DEPRECATED - api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
6316
|
+
More information about the deprecated functionality can be found on the
|
|
6317
|
+
<a href="https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api" target="_blank">Spotify Developer Forum Blog</a>
|
|
6318
|
+
page.
|
|
6319
|
+
</span>
|
|
6320
|
+
|
|
6262
6321
|
Get a sorted list of available genres seed parameter values.
|
|
6263
6322
|
|
|
6264
6323
|
Args:
|
|
@@ -6297,6 +6356,13 @@ class SpotifyClient:
|
|
|
6297
6356
|
_logsi.EnterMethod(SILevel.Debug, apiMethodName)
|
|
6298
6357
|
_logsi.LogVerbose("Get a sorted list of available genres")
|
|
6299
6358
|
|
|
6359
|
+
# api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
6360
|
+
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT % apiMethodName)
|
|
6361
|
+
|
|
6362
|
+
# validations.
|
|
6363
|
+
if (refresh is None):
|
|
6364
|
+
refresh = True
|
|
6365
|
+
|
|
6300
6366
|
# can we use the cached value?
|
|
6301
6367
|
if (not refresh) and (apiMethodName in self._ConfigurationCache):
|
|
6302
6368
|
|
|
@@ -6416,6 +6482,10 @@ class SpotifyClient:
|
|
|
6416
6482
|
_logsi.EnterMethod(SILevel.Debug, apiMethodName)
|
|
6417
6483
|
_logsi.LogVerbose("Get a sorted list of available markets (country codes)")
|
|
6418
6484
|
|
|
6485
|
+
# validations.
|
|
6486
|
+
if (refresh is None):
|
|
6487
|
+
refresh = True
|
|
6488
|
+
|
|
6419
6489
|
# can we use the cached value?
|
|
6420
6490
|
if (not refresh) and (apiMethodName in self._ConfigurationCache):
|
|
6421
6491
|
|
|
@@ -6556,6 +6626,8 @@ class SpotifyClient:
|
|
|
6556
6626
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get user's available Spotify Connect player device", apiMethodParms)
|
|
6557
6627
|
|
|
6558
6628
|
# validations.
|
|
6629
|
+
if (refresh is None):
|
|
6630
|
+
refresh = True
|
|
6559
6631
|
if deviceId is None:
|
|
6560
6632
|
return None
|
|
6561
6633
|
deviceId = deviceId.lower() # prepare for compare
|
|
@@ -6833,6 +6905,10 @@ class SpotifyClient:
|
|
|
6833
6905
|
apiMethodParms.AppendKeyValue("refresh", refresh)
|
|
6834
6906
|
_logsi.LogMethodParmList(SILevel.Verbose, "Checking Spotify Connect Player device for name", apiMethodParms)
|
|
6835
6907
|
|
|
6908
|
+
# validations.
|
|
6909
|
+
if (refresh is None):
|
|
6910
|
+
refresh = False
|
|
6911
|
+
|
|
6836
6912
|
# if nothing specified then just use it as-is.
|
|
6837
6913
|
if (value is None) or (len(value.strip()) == 0):
|
|
6838
6914
|
_logsi.LogVerbose("Device ID not specified; active device will be used")
|
|
@@ -6942,6 +7018,8 @@ class SpotifyClient:
|
|
|
6942
7018
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get user's available Spotify Connect player devices", apiMethodParms)
|
|
6943
7019
|
|
|
6944
7020
|
# validations.
|
|
7021
|
+
if (refresh is None):
|
|
7022
|
+
refresh = True
|
|
6945
7023
|
if sortResult is None:
|
|
6946
7024
|
sortResult = True
|
|
6947
7025
|
|
|
@@ -7180,6 +7258,10 @@ class SpotifyClient:
|
|
|
7180
7258
|
"""
|
|
7181
7259
|
result:str = None
|
|
7182
7260
|
|
|
7261
|
+
# validations.
|
|
7262
|
+
if (ignoreResponseErrors is None):
|
|
7263
|
+
ignoreResponseErrors = False
|
|
7264
|
+
|
|
7183
7265
|
# get nowplaying status.
|
|
7184
7266
|
nowPlaying:PlayerPlayState = self.GetPlayerNowPlaying(market, additionalTypes='episode')
|
|
7185
7267
|
|
|
@@ -9006,7 +9088,8 @@ class SpotifyClient:
|
|
|
9006
9088
|
Default is 5; value range is 0 - 10.
|
|
9007
9089
|
refreshDeviceList (bool):
|
|
9008
9090
|
True to refresh the Spotify Connect device list; otherwise, False to use the
|
|
9009
|
-
Spotify Connect device list cache.
|
|
9091
|
+
Spotify Connect device list cache.
|
|
9092
|
+
Default is False.
|
|
9010
9093
|
activateDevice (bool):
|
|
9011
9094
|
True to activate the device if necessary; otherwise, False.
|
|
9012
9095
|
Default is True.
|
|
@@ -9058,6 +9141,8 @@ class SpotifyClient:
|
|
|
9058
9141
|
apiMethodParms:SIMethodParmListContext = None
|
|
9059
9142
|
deviceResultId:str = None
|
|
9060
9143
|
deviceResult:SpotifyConnectDevice = None
|
|
9144
|
+
|
|
9145
|
+
DELAY_DISCONNECT:float = 0.350
|
|
9061
9146
|
|
|
9062
9147
|
try:
|
|
9063
9148
|
|
|
@@ -9086,6 +9171,10 @@ class SpotifyClient:
|
|
|
9086
9171
|
verifyTimeout = validateDelay(verifyTimeout, 5, 10)
|
|
9087
9172
|
if (not isinstance(verifyUserContext, bool)):
|
|
9088
9173
|
verifyUserContext = True
|
|
9174
|
+
if (activateDevice is None):
|
|
9175
|
+
activateDevice = True
|
|
9176
|
+
if (refreshDeviceList is None):
|
|
9177
|
+
refreshDeviceList = False
|
|
9089
9178
|
|
|
9090
9179
|
# determine if the device value specified is a name (e.g. "Bose-ST10-1") or
|
|
9091
9180
|
# an id (e.g. "30fbc80e35598f3c242f2120413c943dfd9715fe", "48b677ca-ef9b-516f-b702-93bf2e8c67ba").
|
|
@@ -9099,6 +9188,12 @@ class SpotifyClient:
|
|
|
9099
9188
|
|
|
9100
9189
|
# get all available Spotify Connect devices on the network.
|
|
9101
9190
|
scDevices:SpotifyConnectDevices = self.GetSpotifyConnectDevices(refresh=refreshDeviceList)
|
|
9191
|
+
|
|
9192
|
+
# if we refreshed the device list, then give the device(s) a little time to disconnect so that
|
|
9193
|
+
# a new connection can be established (if required).
|
|
9194
|
+
if (refreshDeviceList):
|
|
9195
|
+
_logsi.LogVerbose(TRACE_MSG_DELAY_DEVICE % DELAY_DISCONNECT)
|
|
9196
|
+
time.sleep(DELAY_DISCONNECT)
|
|
9102
9197
|
|
|
9103
9198
|
# process all discovered devices.
|
|
9104
9199
|
for scDevice in scDevices:
|
|
@@ -9199,7 +9294,17 @@ class SpotifyClient:
|
|
|
9199
9294
|
if (not activateDevice):
|
|
9200
9295
|
_logsi.LogVerbose("Activation not requested for Spotify Connect device: '%s'" % (deviceResult.Title))
|
|
9201
9296
|
break
|
|
9202
|
-
|
|
9297
|
+
|
|
9298
|
+
# does the device need to be activated?
|
|
9299
|
+
# check for the device in the available device list.
|
|
9300
|
+
# if we find it, then there is no need to activate it and we are done.
|
|
9301
|
+
# note - if another user is controlling the device, then it will not be in the active device list
|
|
9302
|
+
# for the current user!
|
|
9303
|
+
device:Device = self.GetPlayerDevice(deviceResultId, refresh=True)
|
|
9304
|
+
if device is not None:
|
|
9305
|
+
_logsi.LogVerbose("Spotify Connect device '%s' is already in the available device list; no need to re-activate" % (deviceResult.Title))
|
|
9306
|
+
break
|
|
9307
|
+
|
|
9203
9308
|
zcfResult:ZeroconfResponse
|
|
9204
9309
|
|
|
9205
9310
|
# disconnect the device.
|
|
@@ -9215,7 +9320,8 @@ class SpotifyClient:
|
|
|
9215
9320
|
# some devices only support a single connection on the spotify connect
|
|
9216
9321
|
# zeroconf webserver, so we have to give it a little time to process the
|
|
9217
9322
|
# disconnect command before we try to call the Connect method.
|
|
9218
|
-
|
|
9323
|
+
_logsi.LogVerbose(TRACE_MSG_DELAY_DEVICE % DELAY_DISCONNECT)
|
|
9324
|
+
time.sleep(DELAY_DISCONNECT)
|
|
9219
9325
|
|
|
9220
9326
|
# connect the device to OUR Spotify Connect user context.
|
|
9221
9327
|
# note that the result here only indicates that the connect was submitted - NOT that it was successful!
|
|
@@ -9356,6 +9462,8 @@ class SpotifyClient:
|
|
|
9356
9462
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get available Spotify Connect devices", apiMethodParms)
|
|
9357
9463
|
|
|
9358
9464
|
# validations.
|
|
9465
|
+
if refresh is None:
|
|
9466
|
+
refresh = True
|
|
9359
9467
|
if sortResult is None:
|
|
9360
9468
|
sortResult = True
|
|
9361
9469
|
|
|
@@ -9609,6 +9717,13 @@ class SpotifyClient:
|
|
|
9609
9717
|
trackId:str=None,
|
|
9610
9718
|
) -> AudioFeatures:
|
|
9611
9719
|
"""
|
|
9720
|
+
<span class="deprecated">
|
|
9721
|
+
DEPRECATED - api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
9722
|
+
More information about the deprecated functionality can be found on the
|
|
9723
|
+
<a href="https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api" target="_blank">Spotify Developer Forum Blog</a>
|
|
9724
|
+
page.
|
|
9725
|
+
</span>
|
|
9726
|
+
|
|
9612
9727
|
Get audio feature information for a single track identified by its unique Spotify ID.
|
|
9613
9728
|
|
|
9614
9729
|
Args:
|
|
@@ -9646,6 +9761,9 @@ class SpotifyClient:
|
|
|
9646
9761
|
apiMethodParms.AppendKeyValue("trackId", trackId)
|
|
9647
9762
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get audio feature information for a single track", apiMethodParms)
|
|
9648
9763
|
|
|
9764
|
+
# api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
9765
|
+
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT % apiMethodName)
|
|
9766
|
+
|
|
9649
9767
|
# if trackId not specified, then return currently playing track id value.
|
|
9650
9768
|
if (trackId is None) or (len(trackId.strip()) == 0):
|
|
9651
9769
|
uri = self.GetPlayerNowPlayingUri('track')
|
|
@@ -10042,6 +10160,13 @@ class SpotifyClient:
|
|
|
10042
10160
|
minValence:float=None, maxValence:float=None, targetValence:float=None
|
|
10043
10161
|
) -> TrackRecommendations:
|
|
10044
10162
|
"""
|
|
10163
|
+
<span class="deprecated">
|
|
10164
|
+
DEPRECATED - api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
10165
|
+
More information about the deprecated functionality can be found on the
|
|
10166
|
+
<a href="https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api" target="_blank">Spotify Developer Forum Blog</a>
|
|
10167
|
+
page.
|
|
10168
|
+
</span>
|
|
10169
|
+
|
|
10045
10170
|
Get track recommendations for specified criteria.
|
|
10046
10171
|
|
|
10047
10172
|
Use the `GetTrackAudioFeatures` method to get an idea of what to specify for some of the
|
|
@@ -10280,6 +10405,9 @@ class SpotifyClient:
|
|
|
10280
10405
|
apiMethodParms.AppendKeyValue("targetValence", targetValence)
|
|
10281
10406
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get track recommendations for specified criteria", apiMethodParms)
|
|
10282
10407
|
|
|
10408
|
+
# api endpoint no longer supported by Spotify as of 2024/11/27.
|
|
10409
|
+
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT % apiMethodName)
|
|
10410
|
+
|
|
10283
10411
|
# ensure market was either supplied or implied; default if neither.
|
|
10284
10412
|
market = self._ValidateMarket(market)
|
|
10285
10413
|
|
|
@@ -10511,6 +10639,10 @@ class SpotifyClient:
|
|
|
10511
10639
|
apiMethodParms = _logsi.EnterMethodParmList(SILevel.Debug, apiMethodName)
|
|
10512
10640
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get profile information about the current user", apiMethodParms)
|
|
10513
10641
|
|
|
10642
|
+
# validations.
|
|
10643
|
+
if (refresh is None):
|
|
10644
|
+
refresh = True
|
|
10645
|
+
|
|
10514
10646
|
# can we use the cached value?
|
|
10515
10647
|
if (not refresh) and (apiMethodName in self._ConfigurationCache):
|
|
10516
10648
|
|
|
@@ -11268,12 +11400,13 @@ class SpotifyClient:
|
|
|
11268
11400
|
|
|
11269
11401
|
# validations.
|
|
11270
11402
|
delay = validateDelay(delay, 0.50, 10)
|
|
11403
|
+
if (resolveDeviceId is None):
|
|
11404
|
+
resolveDeviceId = True
|
|
11271
11405
|
|
|
11272
11406
|
# has the device id been resolved?
|
|
11273
11407
|
if (resolveDeviceId):
|
|
11274
11408
|
|
|
11275
|
-
# no - ensure the specified device id / name is active and available
|
|
11276
|
-
# the user context is set correctly.
|
|
11409
|
+
# no - ensure the specified device id / name is active and available.
|
|
11277
11410
|
scDevice = self.GetSpotifyConnectDevice(
|
|
11278
11411
|
deviceId,
|
|
11279
11412
|
refreshDeviceList=False,
|
|
@@ -11397,6 +11530,10 @@ class SpotifyClient:
|
|
|
11397
11530
|
|
|
11398
11531
|
# validations.
|
|
11399
11532
|
delay = validateDelay(delay, 0.50, 10)
|
|
11533
|
+
if (shuffle is None):
|
|
11534
|
+
shuffle = True
|
|
11535
|
+
if (resolveDeviceId is None):
|
|
11536
|
+
resolveDeviceId = True
|
|
11400
11537
|
|
|
11401
11538
|
# get current users favorite tracks.
|
|
11402
11539
|
tracks:TrackPageSaved = self.GetTrackFavorites(limitTotal=limitTotal)
|
|
@@ -11413,8 +11550,7 @@ class SpotifyClient:
|
|
|
11413
11550
|
# has the device id been resolved?
|
|
11414
11551
|
if (resolveDeviceId):
|
|
11415
11552
|
|
|
11416
|
-
# no - ensure the specified device id / name is active and available
|
|
11417
|
-
# the user context is set correctly.
|
|
11553
|
+
# no - ensure the specified device id / name is active and available.
|
|
11418
11554
|
scDevice = self.GetSpotifyConnectDevice(
|
|
11419
11555
|
deviceId,
|
|
11420
11556
|
refreshDeviceList=False,
|
|
@@ -11526,6 +11662,8 @@ class SpotifyClient:
|
|
|
11526
11662
|
|
|
11527
11663
|
# validations.
|
|
11528
11664
|
delay = validateDelay(delay, 0.50, 10)
|
|
11665
|
+
if (resolveDeviceId is None):
|
|
11666
|
+
resolveDeviceId = True
|
|
11529
11667
|
|
|
11530
11668
|
# build a list of all item uri's.
|
|
11531
11669
|
# remove any leading / trailing spaces in case user put a space between the items.
|
|
@@ -11540,8 +11678,7 @@ class SpotifyClient:
|
|
|
11540
11678
|
# has the device id been resolved?
|
|
11541
11679
|
if (resolveDeviceId):
|
|
11542
11680
|
|
|
11543
|
-
# no - ensure the specified device id / name is active and available
|
|
11544
|
-
# the user context is set correctly.
|
|
11681
|
+
# no - ensure the specified device id / name is active and available.
|
|
11545
11682
|
scDevice = self.GetSpotifyConnectDevice(
|
|
11546
11683
|
deviceId,
|
|
11547
11684
|
refreshDeviceList=False,
|
|
@@ -12275,7 +12412,7 @@ class SpotifyClient:
|
|
|
12275
12412
|
The shuffle mode to set:
|
|
12276
12413
|
- `True` - Shuffle user's playback.
|
|
12277
12414
|
- `False` - Do not shuffle user's playback.
|
|
12278
|
-
Default
|
|
12415
|
+
Default is False
|
|
12279
12416
|
deviceId (str):
|
|
12280
12417
|
The id or name of the device this command is targeting.
|
|
12281
12418
|
If not supplied, the user's currently active device is the target.
|
|
@@ -12540,9 +12677,14 @@ class SpotifyClient:
|
|
|
12540
12677
|
|
|
12541
12678
|
# validations.
|
|
12542
12679
|
delay = validateDelay(delay, 0.50, 10)
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
|
|
12680
|
+
if (play is None):
|
|
12681
|
+
play = True
|
|
12682
|
+
if (refreshDeviceList is None):
|
|
12683
|
+
refreshDeviceList = True
|
|
12684
|
+
if (forceActivateDevice is None):
|
|
12685
|
+
forceActivateDevice = True
|
|
12686
|
+
|
|
12687
|
+
# ensure the specified device id / name is active and available.
|
|
12546
12688
|
scDevice = self.GetSpotifyConnectDevice(
|
|
12547
12689
|
deviceId,
|
|
12548
12690
|
refreshDeviceList=refreshDeviceList,
|
|
@@ -12567,7 +12709,7 @@ class SpotifyClient:
|
|
|
12567
12709
|
{
|
|
12568
12710
|
'device_ids': [deviceId]
|
|
12569
12711
|
}
|
|
12570
|
-
if play is not None:
|
|
12712
|
+
if (play is not None):
|
|
12571
12713
|
reqData['play'] = play
|
|
12572
12714
|
|
|
12573
12715
|
# execute spotify web api request.
|
|
@@ -12580,6 +12722,13 @@ class SpotifyClient:
|
|
|
12580
12722
|
if delay > 0:
|
|
12581
12723
|
_logsi.LogVerbose(TRACE_MSG_DELAY_DEVICE % delay)
|
|
12582
12724
|
time.sleep(delay)
|
|
12725
|
+
|
|
12726
|
+
# if forceActivateDevice=True, then we need to resume play manually if play=True
|
|
12727
|
+
# was specified; this is due to the device losing its current status since it
|
|
12728
|
+
# was being forcefully activated (e.g. disconnected and reconnected).
|
|
12729
|
+
if (forceActivateDevice) and (play):
|
|
12730
|
+
_logsi.LogVerbose('Resuming play on device that was forcefully activated')
|
|
12731
|
+
self.PlayerMediaResume()
|
|
12583
12732
|
|
|
12584
12733
|
# process results.
|
|
12585
12734
|
# no results to process - this is pass or fail.
|
|
@@ -12661,6 +12810,8 @@ class SpotifyClient:
|
|
|
12661
12810
|
|
|
12662
12811
|
# validations.
|
|
12663
12812
|
delay = validateDelay(delay, 0.50, 10)
|
|
12813
|
+
if (play is None):
|
|
12814
|
+
play = False
|
|
12664
12815
|
|
|
12665
12816
|
# get current Spotify Connect player state.
|
|
12666
12817
|
result = self.GetPlayerPlaybackState()
|
|
@@ -15624,6 +15775,8 @@ class SpotifyClient:
|
|
|
15624
15775
|
if scope is not None:
|
|
15625
15776
|
if (not isinstance(scope, list)) and (not isinstance(scope, str)):
|
|
15626
15777
|
raise SpotifyApiError(SAAppMessages.ARGUMENT_TYPE_ERROR % (apiMethodName, 'scope', 'list', type(scope).__name__), logsi=_logsi)
|
|
15778
|
+
if (forceAuthorize is None):
|
|
15779
|
+
forceAuthorize = False
|
|
15627
15780
|
|
|
15628
15781
|
# create oauth provider for spotify authentication code with pkce.
|
|
15629
15782
|
self._AuthClient:AuthClient = AuthClient(
|
|
@@ -15807,6 +15960,8 @@ class SpotifyClient:
|
|
|
15807
15960
|
if scope is not None:
|
|
15808
15961
|
if (not isinstance(scope, list)) and (not isinstance(scope, str)):
|
|
15809
15962
|
raise SpotifyApiError(SAAppMessages.ARGUMENT_TYPE_ERROR % (apiMethodName, 'scope', 'list', type(scope).__name__), logsi=_logsi)
|
|
15963
|
+
if (forceAuthorize is None):
|
|
15964
|
+
forceAuthorize = False
|
|
15810
15965
|
|
|
15811
15966
|
# create oauth provider for spotify authentication code with pkce.
|
|
15812
15967
|
self._AuthClient:AuthClient = AuthClient(
|
|
File without changes
|
|
File without changes
|
{spotifywebapiPython-1.0.121.dist-info → spotifywebapiPython-1.0.123.dist-info}/top_level.txt
RENAMED
|
File without changes
|