spotifywebapiPython 1.0.57__py3-none-any.whl → 1.0.59__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.57.dist-info → spotifywebapiPython-1.0.59.dist-info}/METADATA +1 -1
- {spotifywebapiPython-1.0.57.dist-info → spotifywebapiPython-1.0.59.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/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 +18 -9
- spotifywebapipython/docs/spotifywebapiPython/spotifydiscovery.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifywebapiauthenticationerror.html +2 -2
- spotifywebapipython/docs/spotifywebapiPython/spotifywebapierror.html +2 -2
- spotifywebapipython/spotifyclient.py +79 -41
- {spotifywebapiPython-1.0.57.dist-info → spotifywebapiPython-1.0.59.dist-info}/LICENSE +0 -0
- {spotifywebapiPython-1.0.57.dist-info → spotifywebapiPython-1.0.59.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.57.dist-info → spotifywebapiPython-1.0.59.dist-info}/top_level.txt +0 -0
|
@@ -9467,14 +9467,16 @@ class SpotifyClient:
|
|
|
9467
9467
|
_logsi.LeaveMethod(SILevel.Debug, apiMethodName)
|
|
9468
9468
|
|
|
9469
9469
|
|
|
9470
|
-
def PlayerMediaPlayContext(
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9470
|
+
def PlayerMediaPlayContext(
|
|
9471
|
+
self,
|
|
9472
|
+
contextUri:str,
|
|
9473
|
+
offsetUri:str=None,
|
|
9474
|
+
offsetPosition:int=None,
|
|
9475
|
+
positionMS:int=0,
|
|
9476
|
+
deviceId:str=None,
|
|
9477
|
+
delay:float=0.50,
|
|
9478
|
+
resolveDeviceId:bool=True,
|
|
9479
|
+
) -> None:
|
|
9478
9480
|
"""
|
|
9479
9481
|
Start playing one or more tracks of the specified context on a Spotify Connect device.
|
|
9480
9482
|
|
|
@@ -9513,6 +9515,9 @@ class SpotifyClient:
|
|
|
9513
9515
|
This delay will give the spotify web api time to process the change before
|
|
9514
9516
|
another command is issued.
|
|
9515
9517
|
Default is 0.50; value range is 0 - 10.
|
|
9518
|
+
resolveDeviceId (bool):
|
|
9519
|
+
True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
|
|
9520
|
+
value as it has already been resolved.
|
|
9516
9521
|
|
|
9517
9522
|
Raises:
|
|
9518
9523
|
SpotifyWebApiError:
|
|
@@ -9559,14 +9564,18 @@ class SpotifyClient:
|
|
|
9559
9564
|
apiMethodParms.AppendKeyValue("positionMS", positionMS)
|
|
9560
9565
|
apiMethodParms.AppendKeyValue("deviceId", deviceId)
|
|
9561
9566
|
apiMethodParms.AppendKeyValue("delay", delay)
|
|
9567
|
+
apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
|
|
9562
9568
|
_logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device play context", apiMethodParms)
|
|
9563
9569
|
|
|
9564
9570
|
# validations.
|
|
9565
9571
|
delay = validateDelay(delay, 0.50, 10)
|
|
9566
9572
|
|
|
9567
|
-
#
|
|
9568
|
-
|
|
9569
|
-
|
|
9573
|
+
# has the device id been resolved?
|
|
9574
|
+
if (resolveDeviceId):
|
|
9575
|
+
|
|
9576
|
+
# ensure the specified device id / name is active and available, and
|
|
9577
|
+
# the user context is set correctly.
|
|
9578
|
+
deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
|
|
9570
9579
|
|
|
9571
9580
|
# build spotify web api request parameters.
|
|
9572
9581
|
reqData:dict = \
|
|
@@ -9613,11 +9622,13 @@ class SpotifyClient:
|
|
|
9613
9622
|
_logsi.LeaveMethod(SILevel.Debug, apiMethodName)
|
|
9614
9623
|
|
|
9615
9624
|
|
|
9616
|
-
def PlayerMediaPlayTrackFavorites(
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9625
|
+
def PlayerMediaPlayTrackFavorites(
|
|
9626
|
+
self,
|
|
9627
|
+
deviceId:str=None,
|
|
9628
|
+
shuffle:bool=True,
|
|
9629
|
+
delay:float=0.50,
|
|
9630
|
+
resolveDeviceId:bool=True,
|
|
9631
|
+
) -> None:
|
|
9621
9632
|
"""
|
|
9622
9633
|
Get a list of the tracks saved in the current Spotify user's 'Your Library'
|
|
9623
9634
|
and starts playing them.
|
|
@@ -9635,6 +9646,9 @@ class SpotifyClient:
|
|
|
9635
9646
|
This delay will give the spotify web api time to process the change before
|
|
9636
9647
|
another command is issued.
|
|
9637
9648
|
Default is 0.50; value range is 0 - 10.
|
|
9649
|
+
resolveDeviceId (bool):
|
|
9650
|
+
True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
|
|
9651
|
+
value as it has already been resolved.
|
|
9638
9652
|
|
|
9639
9653
|
Raises:
|
|
9640
9654
|
SpotifyWebApiError:
|
|
@@ -9665,6 +9679,7 @@ class SpotifyClient:
|
|
|
9665
9679
|
apiMethodParms.AppendKeyValue("deviceId", deviceId)
|
|
9666
9680
|
apiMethodParms.AppendKeyValue("shuffle", shuffle)
|
|
9667
9681
|
apiMethodParms.AppendKeyValue("delay", delay)
|
|
9682
|
+
apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
|
|
9668
9683
|
_logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device play track favorites", apiMethodParms)
|
|
9669
9684
|
|
|
9670
9685
|
# validations.
|
|
@@ -9682,15 +9697,19 @@ class SpotifyClient:
|
|
|
9682
9697
|
for trackSaved in tracks.Items:
|
|
9683
9698
|
arrUris.append(trackSaved.Track.Uri)
|
|
9684
9699
|
|
|
9685
|
-
#
|
|
9686
|
-
|
|
9687
|
-
|
|
9700
|
+
# has the device id been resolved?
|
|
9701
|
+
if (resolveDeviceId):
|
|
9702
|
+
|
|
9703
|
+
# ensure the specified device id / name is active and available, and
|
|
9704
|
+
# the user context is set correctly.
|
|
9705
|
+
deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
|
|
9688
9706
|
|
|
9689
9707
|
# set desired shuffle mode.
|
|
9690
9708
|
self.PlayerSetShuffleMode(shuffle, deviceId, delay)
|
|
9691
9709
|
|
|
9692
9710
|
# play the tracks.
|
|
9693
|
-
|
|
9711
|
+
# indicate device id has already been resolved.
|
|
9712
|
+
self.PlayerMediaPlayTracks(arrUris, deviceId=deviceId, delay=delay, resolveDeviceId=False)
|
|
9694
9713
|
|
|
9695
9714
|
# process results.
|
|
9696
9715
|
# no results to process - this is pass or fail.
|
|
@@ -9710,12 +9729,14 @@ class SpotifyClient:
|
|
|
9710
9729
|
_logsi.LeaveMethod(SILevel.Debug, apiMethodName)
|
|
9711
9730
|
|
|
9712
9731
|
|
|
9713
|
-
def PlayerMediaPlayTracks(
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9732
|
+
def PlayerMediaPlayTracks(
|
|
9733
|
+
self,
|
|
9734
|
+
uris:list[str],
|
|
9735
|
+
positionMS:int=0,
|
|
9736
|
+
deviceId:str=None,
|
|
9737
|
+
delay:float=0.50,
|
|
9738
|
+
resolveDeviceId:bool=True,
|
|
9739
|
+
) -> None:
|
|
9719
9740
|
"""
|
|
9720
9741
|
Start playing one or more tracks on the specified Spotify Connect device.
|
|
9721
9742
|
|
|
@@ -9744,6 +9765,9 @@ class SpotifyClient:
|
|
|
9744
9765
|
This delay will give the spotify web api time to process the change before
|
|
9745
9766
|
another command is issued.
|
|
9746
9767
|
Default is 0.50; value range is 0 - 10.
|
|
9768
|
+
resolveDeviceId (bool):
|
|
9769
|
+
True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
|
|
9770
|
+
value as it has already been resolved.
|
|
9747
9771
|
|
|
9748
9772
|
Raises:
|
|
9749
9773
|
SpotifyWebApiError:
|
|
@@ -9774,6 +9798,7 @@ class SpotifyClient:
|
|
|
9774
9798
|
apiMethodParms.AppendKeyValue("positionMS", positionMS)
|
|
9775
9799
|
apiMethodParms.AppendKeyValue("deviceId", deviceId)
|
|
9776
9800
|
apiMethodParms.AppendKeyValue("delay", delay)
|
|
9801
|
+
apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
|
|
9777
9802
|
_logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device play tracks", apiMethodParms)
|
|
9778
9803
|
|
|
9779
9804
|
# validations.
|
|
@@ -9788,10 +9813,13 @@ class SpotifyClient:
|
|
|
9788
9813
|
arrUris = uris.split(',')
|
|
9789
9814
|
for idx in range(0, len(arrUris)):
|
|
9790
9815
|
arrUris[idx] = arrUris[idx].strip()
|
|
9816
|
+
|
|
9817
|
+
# has the device id been resolved?
|
|
9818
|
+
if (resolveDeviceId):
|
|
9791
9819
|
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
9820
|
+
# ensure the specified device id / name is active and available, and
|
|
9821
|
+
# the user context is set correctly.
|
|
9822
|
+
deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
|
|
9795
9823
|
|
|
9796
9824
|
# build spotify web api request parameters.
|
|
9797
9825
|
reqData:dict = \
|
|
@@ -10235,8 +10263,8 @@ class SpotifyClient:
|
|
|
10235
10263
|
|
|
10236
10264
|
Returns:
|
|
10237
10265
|
A device Id for the deviceValue if one could be resolved;
|
|
10238
|
-
otherwise,
|
|
10239
|
-
|
|
10266
|
+
otherwise, a null value with the understanding that subsequent operations will probably
|
|
10267
|
+
fail since it's not in the device list.
|
|
10240
10268
|
|
|
10241
10269
|
Raises:
|
|
10242
10270
|
SpotifyWebApiError:
|
|
@@ -10254,7 +10282,8 @@ class SpotifyClient:
|
|
|
10254
10282
|
alias ID's or Names that are in use (for multi-room configurations).
|
|
10255
10283
|
|
|
10256
10284
|
The device ID value is returned if a match is found or if the `device_value` argument is null;
|
|
10257
|
-
otherwise, a
|
|
10285
|
+
otherwise, a null value with the understanding that subsequent operations will probably fail
|
|
10286
|
+
since it's not in the device list.
|
|
10258
10287
|
|
|
10259
10288
|
A user context switch will also be performed if a device id is resolved AND the active user of the
|
|
10260
10289
|
device does not match the `SpotifyConnectUsername` argument specified on the class constructor.
|
|
@@ -10423,7 +10452,7 @@ class SpotifyClient:
|
|
|
10423
10452
|
|
|
10424
10453
|
# did we resolve the device id?
|
|
10425
10454
|
if deviceIdResult is None:
|
|
10426
|
-
|
|
10455
|
+
_logsi.LogWarning("Spotify Connect Device '%s' could not be found; please ensure that the specified device is powered on and available on the local network" % (deviceValue))
|
|
10427
10456
|
|
|
10428
10457
|
# return the resolved device id.
|
|
10429
10458
|
return deviceIdResult
|
|
@@ -10738,11 +10767,13 @@ class SpotifyClient:
|
|
|
10738
10767
|
_logsi.LeaveMethod(SILevel.Debug, apiMethodName)
|
|
10739
10768
|
|
|
10740
10769
|
|
|
10741
|
-
def PlayerTransferPlayback(
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10770
|
+
def PlayerTransferPlayback(
|
|
10771
|
+
self,
|
|
10772
|
+
deviceId:str=None,
|
|
10773
|
+
play:bool=True,
|
|
10774
|
+
delay:float=0.50,
|
|
10775
|
+
resolveDeviceId:bool=True,
|
|
10776
|
+
) -> None:
|
|
10746
10777
|
"""
|
|
10747
10778
|
Transfer playback to a new Spotify Connect device and optionally begin playback.
|
|
10748
10779
|
|
|
@@ -10763,6 +10794,9 @@ class SpotifyClient:
|
|
|
10763
10794
|
This delay will give the spotify web api time to process the change before
|
|
10764
10795
|
another command is issued.
|
|
10765
10796
|
Default is 0.50; value range is 0 - 10.
|
|
10797
|
+
resolveDeviceId (bool):
|
|
10798
|
+
True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
|
|
10799
|
+
value as it has already been resolved.
|
|
10766
10800
|
|
|
10767
10801
|
Raises:
|
|
10768
10802
|
SpotifyWebApiError:
|
|
@@ -10792,14 +10826,18 @@ class SpotifyClient:
|
|
|
10792
10826
|
apiMethodParms.AppendKeyValue("deviceId", deviceId)
|
|
10793
10827
|
apiMethodParms.AppendKeyValue("play", play)
|
|
10794
10828
|
apiMethodParms.AppendKeyValue("delay", delay)
|
|
10829
|
+
apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
|
|
10795
10830
|
_logsi.LogMethodParmList(SILevel.Verbose, "Transfer playback to a new Spotify Connect device", apiMethodParms)
|
|
10796
10831
|
|
|
10797
10832
|
# validations.
|
|
10798
10833
|
delay = validateDelay(delay, 0.50, 10)
|
|
10799
10834
|
|
|
10800
|
-
#
|
|
10801
|
-
|
|
10802
|
-
|
|
10835
|
+
# has the device id been resolved?
|
|
10836
|
+
if (resolveDeviceId):
|
|
10837
|
+
|
|
10838
|
+
# ensure the specified device id / name is active and available, and
|
|
10839
|
+
# the user context is set correctly.
|
|
10840
|
+
deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
|
|
10803
10841
|
|
|
10804
10842
|
# build spotify web api request parameters.
|
|
10805
10843
|
reqData:dict = \
|
|
File without changes
|
|
File without changes
|
|
File without changes
|