spotifywebapiPython 1.0.101__py3-none-any.whl → 1.0.103__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.101.dist-info → spotifywebapiPython-1.0.103.dist-info}/METADATA +1 -1
- {spotifywebapiPython-1.0.101.dist-info → spotifywebapiPython-1.0.103.dist-info}/RECORD +20 -20
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +14 -2
- spotifywebapipython/docs/index.html +2 -2
- spotifywebapipython/docs/search.js +1 -1
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/const.html +3 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/saappmessages.html +2 -2
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/sautils.html +2 -2
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyapierror.html +2 -2
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyapimessage.html +2 -2
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyauthtoken.html +2 -2
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyclient.html +76 -5
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifydiscovery.html +2 -2
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifywebapiauthenticationerror.html +2 -2
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifywebapierror.html +2 -2
- spotifywebapipython/spotifyclient.py +109 -6
- {spotifywebapiPython-1.0.101.dist-info → spotifywebapiPython-1.0.103.dist-info}/LICENSE +0 -0
- {spotifywebapiPython-1.0.101.dist-info → spotifywebapiPython-1.0.103.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.101.dist-info → spotifywebapiPython-1.0.103.dist-info}/top_level.txt +0 -0
|
@@ -2656,6 +2656,8 @@ class SpotifyClient:
|
|
|
2656
2656
|
offset = 0
|
|
2657
2657
|
if not isinstance(limitTotal, int):
|
|
2658
2658
|
limitTotal = 0
|
|
2659
|
+
if sortResult is None:
|
|
2660
|
+
sortResult = True
|
|
2659
2661
|
|
|
2660
2662
|
# are we auto-paging? if so, then use max limit.
|
|
2661
2663
|
if limitTotal > 0:
|
|
@@ -2822,6 +2824,8 @@ class SpotifyClient:
|
|
|
2822
2824
|
offset = 0
|
|
2823
2825
|
if not isinstance(limitTotal, int):
|
|
2824
2826
|
limitTotal = 0
|
|
2827
|
+
if sortResult is None:
|
|
2828
|
+
sortResult = True
|
|
2825
2829
|
|
|
2826
2830
|
# are we auto-paging? if so, then use max limit.
|
|
2827
2831
|
if limitTotal > 0:
|
|
@@ -3344,6 +3348,8 @@ class SpotifyClient:
|
|
|
3344
3348
|
offset = 0
|
|
3345
3349
|
if not isinstance(limitTotal, int):
|
|
3346
3350
|
limitTotal = 0
|
|
3351
|
+
if sortResult is None:
|
|
3352
|
+
sortResult = True
|
|
3347
3353
|
|
|
3348
3354
|
# are we auto-paging? if so, then use max limit.
|
|
3349
3355
|
if limitTotal > 0:
|
|
@@ -3923,6 +3929,8 @@ class SpotifyClient:
|
|
|
3923
3929
|
limit = 20
|
|
3924
3930
|
if not isinstance(limitTotal, int):
|
|
3925
3931
|
limitTotal = 0
|
|
3932
|
+
if sortResult is None:
|
|
3933
|
+
sortResult = True
|
|
3926
3934
|
|
|
3927
3935
|
# are we auto-paging? if so, then use max limit.
|
|
3928
3936
|
if limitTotal > 0:
|
|
@@ -4464,6 +4472,8 @@ class SpotifyClient:
|
|
|
4464
4472
|
offset = 0
|
|
4465
4473
|
if not isinstance(limitTotal, int):
|
|
4466
4474
|
limitTotal = 0
|
|
4475
|
+
if sortResult is None:
|
|
4476
|
+
sortResult = True
|
|
4467
4477
|
|
|
4468
4478
|
# are we auto-paging? if so, then use max limit.
|
|
4469
4479
|
if limitTotal > 0:
|
|
@@ -4849,6 +4859,8 @@ class SpotifyClient:
|
|
|
4849
4859
|
offset = 0
|
|
4850
4860
|
if not isinstance(limitTotal, int):
|
|
4851
4861
|
limitTotal = 0
|
|
4862
|
+
if sortResult is None:
|
|
4863
|
+
sortResult = True
|
|
4852
4864
|
|
|
4853
4865
|
# are we auto-paging? if so, then use max limit.
|
|
4854
4866
|
if limitTotal > 0:
|
|
@@ -5130,6 +5142,8 @@ class SpotifyClient:
|
|
|
5130
5142
|
offset = 0
|
|
5131
5143
|
if not isinstance(limitTotal, int):
|
|
5132
5144
|
limitTotal = 0
|
|
5145
|
+
if sortResult is None:
|
|
5146
|
+
sortResult = True
|
|
5133
5147
|
|
|
5134
5148
|
# are we auto-paging? if so, then use max limit.
|
|
5135
5149
|
if limitTotal > 0:
|
|
@@ -5586,6 +5600,8 @@ class SpotifyClient:
|
|
|
5586
5600
|
offset = 0
|
|
5587
5601
|
if not isinstance(limitTotal, int):
|
|
5588
5602
|
limitTotal = 0
|
|
5603
|
+
if sortResult is None:
|
|
5604
|
+
sortResult = True
|
|
5589
5605
|
|
|
5590
5606
|
# are we auto-paging? if so, then use max limit.
|
|
5591
5607
|
if limitTotal > 0:
|
|
@@ -5867,6 +5883,8 @@ class SpotifyClient:
|
|
|
5867
5883
|
offset = 0
|
|
5868
5884
|
if not isinstance(limitTotal, int):
|
|
5869
5885
|
limitTotal = 0
|
|
5886
|
+
if sortResult is None:
|
|
5887
|
+
sortResult = True
|
|
5870
5888
|
|
|
5871
5889
|
# are we auto-paging? if so, then use max limit.
|
|
5872
5890
|
if limitTotal > 0:
|
|
@@ -6648,6 +6666,10 @@ class SpotifyClient:
|
|
|
6648
6666
|
apiMethodParms.AppendKeyValue("sortResult", sortResult)
|
|
6649
6667
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get user's available Spotify Connect player devices", apiMethodParms)
|
|
6650
6668
|
|
|
6669
|
+
# validations.
|
|
6670
|
+
if sortResult is None:
|
|
6671
|
+
sortResult = True
|
|
6672
|
+
|
|
6651
6673
|
# can we use the cached value?
|
|
6652
6674
|
if (not refresh) and (apiMethodName in self._ConfigurationCache):
|
|
6653
6675
|
|
|
@@ -7853,6 +7875,8 @@ class SpotifyClient:
|
|
|
7853
7875
|
offset = 0
|
|
7854
7876
|
if not isinstance(limitTotal, int):
|
|
7855
7877
|
limitTotal = 0
|
|
7878
|
+
if sortResult is None:
|
|
7879
|
+
sortResult = True
|
|
7856
7880
|
|
|
7857
7881
|
# are we auto-paging? if so, then use max limit.
|
|
7858
7882
|
if limitTotal > 0:
|
|
@@ -8011,6 +8035,8 @@ class SpotifyClient:
|
|
|
8011
8035
|
offset = 0
|
|
8012
8036
|
if not isinstance(limitTotal, int):
|
|
8013
8037
|
limitTotal = 0
|
|
8038
|
+
if sortResult is None:
|
|
8039
|
+
sortResult = True
|
|
8014
8040
|
|
|
8015
8041
|
# are we auto-paging? if so, then use max limit.
|
|
8016
8042
|
if limitTotal > 0:
|
|
@@ -8372,6 +8398,7 @@ class SpotifyClient:
|
|
|
8372
8398
|
offset:int=0,
|
|
8373
8399
|
limitTotal:int=None,
|
|
8374
8400
|
sortResult:bool=True,
|
|
8401
|
+
excludeAudiobooks:bool=True,
|
|
8375
8402
|
) -> ShowPageSaved:
|
|
8376
8403
|
"""
|
|
8377
8404
|
Get a list of the shows saved in the current Spotify user's 'Your Library'.
|
|
@@ -8397,6 +8424,10 @@ class SpotifyClient:
|
|
|
8397
8424
|
True to sort the items by name; otherwise, False to leave the items in the same order they
|
|
8398
8425
|
were returned in by the Spotify Web API.
|
|
8399
8426
|
Default: True
|
|
8427
|
+
excludeAudiobooks (bool):
|
|
8428
|
+
True to exclude audiobook shows from the returned list, leaving only podcast shows;
|
|
8429
|
+
otherwise, False to include all results returned by the Spotify Web API.
|
|
8430
|
+
Default: True
|
|
8400
8431
|
|
|
8401
8432
|
Returns:
|
|
8402
8433
|
An `ShowPageSaved` object that contains saved show information.
|
|
@@ -8407,6 +8438,11 @@ class SpotifyClient:
|
|
|
8407
8438
|
and the response contains error information.
|
|
8408
8439
|
SpotifApiError:
|
|
8409
8440
|
If the method fails for any other reason.
|
|
8441
|
+
|
|
8442
|
+
For some reason, Spotify Web API returns audiobooks AND podcasts with the `/me/shows` service.
|
|
8443
|
+
Spotify Web API returns only audiobooks with the `/me/audiobooks` service.
|
|
8444
|
+
The reasoning for that is unclear, but the `excludeAudiobooks` argument allows you to
|
|
8445
|
+
only return podcast shows in the results if desired.
|
|
8410
8446
|
|
|
8411
8447
|
<details>
|
|
8412
8448
|
<summary>Sample Code - Manual Paging</summary>
|
|
@@ -8433,6 +8469,7 @@ class SpotifyClient:
|
|
|
8433
8469
|
apiMethodParms.AppendKeyValue("offset", offset)
|
|
8434
8470
|
apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
|
|
8435
8471
|
apiMethodParms.AppendKeyValue("sortResult", sortResult)
|
|
8472
|
+
apiMethodParms.AppendKeyValue("excludeAudiobooks", excludeAudiobooks)
|
|
8436
8473
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the users show favorites", apiMethodParms)
|
|
8437
8474
|
|
|
8438
8475
|
# validations.
|
|
@@ -8442,6 +8479,10 @@ class SpotifyClient:
|
|
|
8442
8479
|
offset = 0
|
|
8443
8480
|
if not isinstance(limitTotal, int):
|
|
8444
8481
|
limitTotal = 0
|
|
8482
|
+
if sortResult is None:
|
|
8483
|
+
sortResult = True
|
|
8484
|
+
if excludeAudiobooks is None:
|
|
8485
|
+
excludeAudiobooks = True
|
|
8445
8486
|
|
|
8446
8487
|
# are we auto-paging? if so, then use max limit.
|
|
8447
8488
|
if limitTotal > 0:
|
|
@@ -8493,6 +8534,20 @@ class SpotifyClient:
|
|
|
8493
8534
|
if not self._CheckForNextPageWithOffset(pageObj, result.ItemsCount, limit, limitTotal, urlParms):
|
|
8494
8535
|
break
|
|
8495
8536
|
|
|
8537
|
+
# exclude audiobook shows if requested.
|
|
8538
|
+
if (excludeAudiobooks):
|
|
8539
|
+
|
|
8540
|
+
item:ShowSaved
|
|
8541
|
+
idx:int = 0
|
|
8542
|
+
while idx < len(result.Items):
|
|
8543
|
+
if (result.Items[idx].Show is not None) \
|
|
8544
|
+
and (result.Items[idx].Show.Description is not None) \
|
|
8545
|
+
and (result.Items[idx].Show.Description.startswith('Author(s):')):
|
|
8546
|
+
del result.Items[idx]
|
|
8547
|
+
pageObj.Total -= 1
|
|
8548
|
+
else:
|
|
8549
|
+
idx += 1
|
|
8550
|
+
|
|
8496
8551
|
# update result object with final paging details.
|
|
8497
8552
|
result.Total = pageObj.Total
|
|
8498
8553
|
|
|
@@ -8991,7 +9046,11 @@ class SpotifyClient:
|
|
|
8991
9046
|
apiMethodParms.AppendKeyValue("refresh", refresh)
|
|
8992
9047
|
apiMethodParms.AppendKeyValue("sortResult", sortResult)
|
|
8993
9048
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get available Spotify Connect devices", apiMethodParms)
|
|
8994
|
-
|
|
9049
|
+
|
|
9050
|
+
# validations.
|
|
9051
|
+
if sortResult is None:
|
|
9052
|
+
sortResult = True
|
|
9053
|
+
|
|
8995
9054
|
# can we use the cached value?
|
|
8996
9055
|
if (not refresh) and (apiMethodName in self._ConfigurationCache):
|
|
8997
9056
|
|
|
@@ -9399,6 +9458,8 @@ class SpotifyClient:
|
|
|
9399
9458
|
offset = 0
|
|
9400
9459
|
if not isinstance(limitTotal, int):
|
|
9401
9460
|
limitTotal = 0
|
|
9461
|
+
if sortResult is None:
|
|
9462
|
+
sortResult = True
|
|
9402
9463
|
|
|
9403
9464
|
# are we auto-paging? if so, then use max limit.
|
|
9404
9465
|
if limitTotal > 0:
|
|
@@ -10329,6 +10390,8 @@ class SpotifyClient:
|
|
|
10329
10390
|
offset = 0
|
|
10330
10391
|
if not isinstance(limitTotal, int):
|
|
10331
10392
|
limitTotal = 0
|
|
10393
|
+
if sortResult is None:
|
|
10394
|
+
sortResult = True
|
|
10332
10395
|
|
|
10333
10396
|
# are we auto-paging? if so, then use max limit.
|
|
10334
10397
|
if limitTotal > 0:
|
|
@@ -10493,6 +10556,8 @@ class SpotifyClient:
|
|
|
10493
10556
|
offset = 0
|
|
10494
10557
|
if not isinstance(limitTotal, int):
|
|
10495
10558
|
limitTotal = 0
|
|
10559
|
+
if sortResult is None:
|
|
10560
|
+
sortResult = True
|
|
10496
10561
|
|
|
10497
10562
|
# are we auto-paging? if so, then use max limit.
|
|
10498
10563
|
if limitTotal > 0:
|
|
@@ -11312,11 +11377,13 @@ class SpotifyClient:
|
|
|
11312
11377
|
_logsi.LeaveMethod(SILevel.Debug, apiMethodName)
|
|
11313
11378
|
|
|
11314
11379
|
|
|
11315
|
-
def PlayerMediaSeek(
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11380
|
+
def PlayerMediaSeek(
|
|
11381
|
+
self,
|
|
11382
|
+
positionMS:int=0,
|
|
11383
|
+
deviceId:str=None,
|
|
11384
|
+
delay:float=0.50,
|
|
11385
|
+
relativePositionMS:int=0,
|
|
11386
|
+
) -> None:
|
|
11320
11387
|
"""
|
|
11321
11388
|
Seeks to the given position in the user's currently playing track for the specified
|
|
11322
11389
|
Spotify Connect device.
|
|
@@ -11339,6 +11406,11 @@ class SpotifyClient:
|
|
|
11339
11406
|
This delay will give the spotify web api time to process the change before
|
|
11340
11407
|
another command is issued.
|
|
11341
11408
|
Default is 0.50; value range is 0 - 10.
|
|
11409
|
+
relativePositionMS (int):
|
|
11410
|
+
The relative position in milliseconds to seek to; can be a positive or negative number.
|
|
11411
|
+
Passing in a positive relative position that causes the position to be greater than the
|
|
11412
|
+
length of the track will cause the player to start playing the next song.
|
|
11413
|
+
Example: `25000`
|
|
11342
11414
|
|
|
11343
11415
|
Raises:
|
|
11344
11416
|
SpotifyWebApiError:
|
|
@@ -11351,12 +11423,24 @@ class SpotifyClient:
|
|
|
11351
11423
|
|
|
11352
11424
|
The order of execution is not guaranteed when you use this API with other Player API endpoints.
|
|
11353
11425
|
|
|
11426
|
+
Note that the `relativePositionMS` functionality is not defined by the Spotify Web API. This
|
|
11427
|
+
argument was added to this API to support "skip" seeking. A positive relative position that causes
|
|
11428
|
+
the seek position to be greater than the length of the track will cause the player to start playing
|
|
11429
|
+
the next song. A negative relative position that causes the seek position to be less than zero
|
|
11430
|
+
will cause the player to start playing the track from the beginning.
|
|
11431
|
+
|
|
11354
11432
|
<details>
|
|
11355
11433
|
<summary>Sample Code</summary>
|
|
11356
11434
|
```python
|
|
11357
11435
|
.. include:: ../docs/include/samplecode/SpotifyClient/PlayerMediaSeek.py
|
|
11358
11436
|
```
|
|
11359
11437
|
</details>
|
|
11438
|
+
<details>
|
|
11439
|
+
<summary>Sample Code - Relative Positioning</summary>
|
|
11440
|
+
```python
|
|
11441
|
+
.. include:: ../docs/include/samplecode/SpotifyClient/PlayerMediaSeek_Relative.py
|
|
11442
|
+
```
|
|
11443
|
+
</details>
|
|
11360
11444
|
"""
|
|
11361
11445
|
apiMethodName:str = 'PlayerMediaSeek'
|
|
11362
11446
|
apiMethodParms:SIMethodParmListContext = None
|
|
@@ -11368,10 +11452,15 @@ class SpotifyClient:
|
|
|
11368
11452
|
apiMethodParms.AppendKeyValue("positionMS", positionMS)
|
|
11369
11453
|
apiMethodParms.AppendKeyValue("deviceId", deviceId)
|
|
11370
11454
|
apiMethodParms.AppendKeyValue("delay", delay)
|
|
11455
|
+
apiMethodParms.AppendKeyValue("relativePositionMS", relativePositionMS)
|
|
11371
11456
|
_logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device seek position", apiMethodParms)
|
|
11372
11457
|
|
|
11373
11458
|
# validations.
|
|
11374
11459
|
delay = validateDelay(delay, 0.50, 10)
|
|
11460
|
+
if (positionMS is None):
|
|
11461
|
+
positionMS = 0
|
|
11462
|
+
if (relativePositionMS is None):
|
|
11463
|
+
relativePositionMS = 0
|
|
11375
11464
|
|
|
11376
11465
|
# if deviceId was not specified, then verify that there is an active player device.
|
|
11377
11466
|
if deviceId is None:
|
|
@@ -11379,6 +11468,20 @@ class SpotifyClient:
|
|
|
11379
11468
|
|
|
11380
11469
|
# check for device name; convert to an id if a name was supplied.
|
|
11381
11470
|
deviceId = self.PlayerConvertDeviceNameToId(deviceId)
|
|
11471
|
+
|
|
11472
|
+
# was relative seeking specified?
|
|
11473
|
+
if (relativePositionMS != 0) and (positionMS == 0):
|
|
11474
|
+
|
|
11475
|
+
# get current track position.
|
|
11476
|
+
playState:PlayerPlayState = self.GetPlayerPlaybackState()
|
|
11477
|
+
newPositionMS:int = playState.ProgressMS
|
|
11478
|
+
if (newPositionMS is not None) and (newPositionMS > 0):
|
|
11479
|
+
|
|
11480
|
+
# calculate new position; if less than zero, then force it to zero.
|
|
11481
|
+
newPositionMS += relativePositionMS
|
|
11482
|
+
if (newPositionMS < 0):
|
|
11483
|
+
newPositionMS = 0
|
|
11484
|
+
positionMS = newPositionMS
|
|
11382
11485
|
|
|
11383
11486
|
# build spotify web api request parameters.
|
|
11384
11487
|
urlParms:dict = \
|
|
File without changes
|
|
File without changes
|
{spotifywebapiPython-1.0.101.dist-info → spotifywebapiPython-1.0.103.dist-info}/top_level.txt
RENAMED
|
File without changes
|