spotifywebapiPython 1.0.263__py3-none-any.whl → 1.0.265__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.
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +15 -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 +13 -65
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +2 -2
- spotifywebapipython/models/playlisttrack.py +5 -1
- spotifywebapipython/spotifyclient.py +229 -240
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastlistener.py +27 -28
- {spotifywebapipython-1.0.263.dist-info → spotifywebapipython-1.0.265.dist-info}/METADATA +1 -1
- {spotifywebapipython-1.0.263.dist-info → spotifywebapipython-1.0.265.dist-info}/RECORD +25 -25
- {spotifywebapipython-1.0.263.dist-info → spotifywebapipython-1.0.265.dist-info}/LICENSE +0 -0
- {spotifywebapipython-1.0.263.dist-info → spotifywebapipython-1.0.265.dist-info}/WHEEL +0 -0
- {spotifywebapipython-1.0.263.dist-info → spotifywebapipython-1.0.265.dist-info}/top_level.txt +0 -0
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</title>
|
|
10
10
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20role%3D%22img%22%20aria-label%3D%22pdoc%20logo%22%20width%3D%22300%22%20height%3D%22150%22%20viewBox%3D%22-1%200%2060%2030%22%3E%3Ctitle%3Epdoc%3C/title%3E%3Cpath%20d%3D%22M29.621%2021.293c-.011-.273-.214-.475-.511-.481a.5.5%200%200%200-.489.503l-.044%201.393c-.097.551-.695%201.215-1.566%201.704-.577.428-1.306.486-2.193.182-1.426-.617-2.467-1.654-3.304-2.487l-.173-.172a3.43%203.43%200%200%200-.365-.306.49.49%200%200%200-.286-.196c-1.718-1.06-4.931-1.47-7.353.191l-.219.15c-1.707%201.187-3.413%202.131-4.328%201.03-.02-.027-.49-.685-.141-1.763.233-.721.546-2.408.772-4.076.042-.09.067-.187.046-.288.166-1.347.277-2.625.241-3.351%201.378-1.008%202.271-2.586%202.271-4.362%200-.976-.272-1.935-.788-2.774-.057-.094-.122-.18-.184-.268.033-.167.052-.339.052-.516%200-1.477-1.202-2.679-2.679-2.679-.791%200-1.496.352-1.987.9a6.3%206.3%200%200%200-1.001.029c-.492-.564-1.207-.929-2.012-.929-1.477%200-2.679%201.202-2.679%202.679A2.65%202.65%200%200%200%20.97%206.554c-.383.747-.595%201.572-.595%202.41%200%202.311%201.507%204.29%203.635%205.107-.037.699-.147%202.27-.423%203.294l-.137.461c-.622%202.042-2.515%208.257%201.727%2010.643%201.614.908%203.06%201.248%204.317%201.248%202.665%200%204.492-1.524%205.322-2.401%201.476-1.559%202.886-1.854%206.491.82%201.877%201.393%203.514%201.753%204.861%201.068%202.223-1.713%202.811-3.867%203.399-6.374.077-.846.056-1.469.054-1.537zm-4.835%204.313c-.054.305-.156.586-.242.629-.034-.007-.131-.022-.307-.157-.145-.111-.314-.478-.456-.908.221.121.432.25.675.355.115.039.219.051.33.081zm-2.251-1.238c-.05.33-.158.648-.252.694-.022.001-.125-.018-.307-.157-.217-.166-.488-.906-.639-1.573.358.344.754.693%201.198%201.036zm-3.887-2.337c-.006-.116-.018-.231-.041-.342.635.145%201.189.368%201.599.625.097.231.166.481.174.642-.03.049-.055.101-.067.158-.046.013-.128.026-.298.004-.278-.037-.901-.57-1.367-1.087zm-1.127-.497c.116.306.176.625.12.71-.019.014-.117.045-.345.016-.206-.027-.604-.332-.986-.695.41-.051.816-.056%201.211-.031zm-4.535%201.535c.209.22.379.47.358.598-.006.041-.088.138-.351.234-.144.055-.539-.063-.979-.259a11.66%2011.66%200%200%200%20.972-.573zm.983-.664c.359-.237.738-.418%201.126-.554.25.237.479.548.457.694-.006.042-.087.138-.351.235-.174.064-.694-.105-1.232-.375zm-3.381%201.794c-.022.145-.061.29-.149.401-.133.166-.358.248-.69.251h-.002c-.133%200-.306-.26-.45-.621.417.091.854.07%201.291-.031zm-2.066-8.077a4.78%204.78%200%200%201-.775-.584c.172-.115.505-.254.88-.378l-.105.962zm-.331%202.302a10.32%2010.32%200%200%201-.828-.502c.202-.143.576-.328.984-.49l-.156.992zm-.45%202.157l-.701-.403c.214-.115.536-.249.891-.376a11.57%2011.57%200%200%201-.19.779zm-.181%201.716c.064.398.194.702.298.893-.194-.051-.435-.162-.736-.398.061-.119.224-.3.438-.495zM8.87%204.141c0%20.152-.123.276-.276.276s-.275-.124-.275-.276.123-.276.276-.276.275.124.275.276zm-.735-.389a1.15%201.15%200%200%200-.314.783%201.16%201.16%200%200%200%201.162%201.162c.457%200%20.842-.27%201.032-.653.026.117.042.238.042.362a1.68%201.68%200%200%201-1.679%201.679%201.68%201.68%200%200%201-1.679-1.679c0-.843.626-1.535%201.436-1.654zM5.059%205.406A1.68%201.68%200%200%201%203.38%207.085a1.68%201.68%200%200%201-1.679-1.679c0-.037.009-.072.011-.109.21.3.541.508.935.508a1.16%201.16%200%200%200%201.162-1.162%201.14%201.14%200%200%200-.474-.912c.015%200%20.03-.005.045-.005.926.001%201.679.754%201.679%201.68zM3.198%204.141c0%20.152-.123.276-.276.276s-.275-.124-.275-.276.123-.276.276-.276.275.124.275.276zM1.375%208.964c0-.52.103-1.035.288-1.52.466.394%201.06.64%201.717.64%201.144%200%202.116-.725%202.499-1.738.383%201.012%201.355%201.738%202.499%201.738.867%200%201.631-.421%202.121-1.062.307.605.478%201.267.478%201.942%200%202.486-2.153%204.51-4.801%204.51s-4.801-2.023-4.801-4.51zm24.342%2019.349c-.985.498-2.267.168-3.813-.979-3.073-2.281-5.453-3.199-7.813-.705-1.315%201.391-4.163%203.365-8.423.97-3.174-1.786-2.239-6.266-1.261-9.479l.146-.492c.276-1.02.395-2.457.444-3.268a6.11%206.11%200%200%200%201.18.115%206.01%206.01%200%200%200%202.536-.562l-.006.175c-.802.215-1.848.612-2.021%201.25-.079.295.021.601.274.837.219.203.415.364.598.501-.667.304-1.243.698-1.311%201.179-.02.144-.022.507.393.787.213.144.395.26.564.365-1.285.521-1.361.96-1.381%201.126-.018.142-.011.496.427.746l.854.489c-.473.389-.971.914-.999%201.429-.018.278.095.532.316.713.675.556%201.231.721%201.653.721.059%200%20.104-.014.158-.02.207.707.641%201.64%201.513%201.64h.013c.8-.008%201.236-.345%201.462-.626.173-.216.268-.457.325-.692.424.195.93.374%201.372.374.151%200%20.294-.021.423-.068.732-.27.944-.704.993-1.021.009-.061.003-.119.002-.179.266.086.538.147.789.147.15%200%20.294-.021.423-.069.542-.2.797-.489.914-.754.237.147.478.258.704.288.106.014.205.021.296.021.356%200%20.595-.101.767-.229.438.435%201.094.992%201.656%201.067.106.014.205.021.296.021a1.56%201.56%200%200%200%20.323-.035c.17.575.453%201.289.866%201.605.358.273.665.362.914.362a.99.99%200%200%200%20.421-.093%201.03%201.03%200%200%200%20.245-.164c.168.428.39.846.68%201.068.358.273.665.362.913.362a.99.99%200%200%200%20.421-.093c.317-.148.512-.448.639-.762.251.157.495.257.726.257.127%200%20.25-.024.37-.071.427-.17.706-.617.841-1.314.022-.015.047-.022.068-.038.067-.051.133-.104.196-.159-.443%201.486-1.107%202.761-2.086%203.257zM8.66%209.925a.5.5%200%201%200-1%200c0%20.653-.818%201.205-1.787%201.205s-1.787-.552-1.787-1.205a.5.5%200%201%200-1%200c0%201.216%201.25%202.205%202.787%202.205s2.787-.989%202.787-2.205zm4.4%2015.965l-.208.097c-2.661%201.258-4.708%201.436-6.086.527-1.542-1.017-1.88-3.19-1.844-4.198a.4.4%200%200%200-.385-.414c-.242-.029-.406.164-.414.385-.046%201.249.367%203.686%202.202%204.896.708.467%201.547.7%202.51.7%201.248%200%202.706-.392%204.362-1.174l.185-.086a.4.4%200%200%200%20.205-.527c-.089-.204-.326-.291-.527-.206zM9.547%202.292c.093.077.205.114.317.114a.5.5%200%200%200%20.318-.886L8.817.397a.5.5%200%200%200-.703.068.5.5%200%200%200%20.069.703l1.364%201.124zm-7.661-.065c.086%200%20.173-.022.253-.068l1.523-.893a.5.5%200%200%200-.506-.863l-1.523.892a.5.5%200%200%200-.179.685c.094.158.261.247.432.247z%22%20transform%3D%22matrix%28-1%200%200%201%2058%200%29%22%20fill%3D%22%233bb300%22/%3E%3Cpath%20d%3D%22M.3%2021.86V10.18q0-.46.02-.68.04-.22.18-.5.28-.54%201.34-.54%201.06%200%201.42.28.38.26.44.78.76-1.04%202.38-1.04%201.64%200%203.1%201.54%201.46%201.54%201.46%203.58%200%202.04-1.46%203.58-1.44%201.54-3.08%201.54-1.64%200-2.38-.92v4.04q0%20.46-.04.68-.02.22-.18.5-.14.3-.5.42-.36.12-.98.12-.62%200-1-.12-.36-.12-.52-.4-.14-.28-.18-.5-.02-.22-.02-.68zm3.96-9.42q-.46.54-.46%201.18%200%20.64.46%201.18.48.52%201.2.52.74%200%201.24-.52.52-.52.52-1.18%200-.66-.48-1.18-.48-.54-1.26-.54-.76%200-1.22.54zm14.741-8.36q.16-.3.54-.42.38-.12%201-.12.64%200%201.02.12.38.12.52.42.16.3.18.54.04.22.04.68v11.94q0%20.46-.04.7-.02.22-.18.5-.3.54-1.7.54-1.38%200-1.54-.98-.84.96-2.34.96-1.8%200-3.28-1.56-1.48-1.58-1.48-3.66%200-2.1%201.48-3.68%201.5-1.58%203.28-1.58%201.48%200%202.3%201v-4.2q0-.46.02-.68.04-.24.18-.52zm-3.24%2010.86q.52.54%201.26.54.74%200%201.22-.54.5-.54.5-1.18%200-.66-.48-1.22-.46-.56-1.26-.56-.8%200-1.28.56-.48.54-.48%201.2%200%20.66.52%201.2zm7.833-1.2q0-2.4%201.68-3.96%201.68-1.56%203.84-1.56%202.16%200%203.82%201.56%201.66%201.54%201.66%203.94%200%201.66-.86%202.96-.86%201.28-2.1%201.9-1.22.6-2.54.6-1.32%200-2.56-.64-1.24-.66-2.1-1.92-.84-1.28-.84-2.88zm4.18%201.44q.64.48%201.3.48.66%200%201.32-.5.66-.5.66-1.48%200-.98-.62-1.46-.62-.48-1.34-.48-.72%200-1.34.5-.62.5-.62%201.48%200%20.96.64%201.46zm11.412-1.44q0%20.84.56%201.32.56.46%201.18.46.64%200%201.18-.36.56-.38.9-.38.6%200%201.46%201.06.46.58.46%201.04%200%20.76-1.1%201.42-1.14.8-2.8.8-1.86%200-3.58-1.34-.82-.64-1.34-1.7-.52-1.08-.52-2.36%200-1.3.52-2.34.52-1.06%201.34-1.7%201.66-1.32%203.54-1.32.76%200%201.48.22.72.2%201.06.4l.32.2q.36.24.56.38.52.4.52.92%200%20.5-.42%201.14-.72%201.1-1.38%201.1-.38%200-1.08-.44-.36-.34-1.04-.34-.66%200-1.24.48-.58.48-.58%201.34z%22%20fill%3D%22green%22/%3E%3C/svg%3E"/>
|
|
11
11
|
<!-- build env - Package Name = "spotifywebapipython" -->
|
|
12
|
-
<!-- build env - Package Version = "1.0.
|
|
12
|
+
<!-- build env - Package Version = "1.0.265" -->
|
|
13
13
|
<!-- pdoc module.modulename = "spotifywebapipython.spotifywebplayertoken" -->
|
|
14
14
|
<!-- pdoc module.is_package = "False" -->
|
|
15
15
|
<!-- pdoc root_module_name = "None" -->
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
<footer class="footertext">
|
|
103
103
|
spotifywebapipython</br>
|
|
104
|
-
Version 1.0.
|
|
104
|
+
Version 1.0.265</br>
|
|
105
105
|
<a href="https://developer.spotify.com/documentation/web-api" target="_blank">
|
|
106
106
|
<img src="../spotifywebapipython.ico" alt="brand icon" style="width:32px; height:32px; padding:4px;"/>
|
|
107
107
|
A Spotify Web Api Client
|
|
@@ -42,7 +42,11 @@ class PlaylistTrack:
|
|
|
42
42
|
item:dict = root.get('track',None)
|
|
43
43
|
if item is not None:
|
|
44
44
|
self._Track = Track(root=item)
|
|
45
|
-
|
|
45
|
+
else:
|
|
46
|
+
# check for post 2026/02 api changes:
|
|
47
|
+
item:dict = root.get('item',None)
|
|
48
|
+
if item is not None:
|
|
49
|
+
self._Track = Track(root=item)
|
|
46
50
|
|
|
47
51
|
def __repr__(self) -> str:
|
|
48
52
|
return self.ToString()
|
|
@@ -3842,14 +3842,6 @@ class SpotifyClient:
|
|
|
3842
3842
|
market:str=None,
|
|
3843
3843
|
) -> list[Album]:
|
|
3844
3844
|
"""
|
|
3845
|
-
<span class="deprecated">
|
|
3846
|
-
DEPRECATED - api endpoint no longer supported by Spotify as of 2026/02/11 for unauthorized Spotify Developer Applications.
|
|
3847
|
-
The api endpoint IS still supported by Spotify for authorized Spotify Developer Applications.
|
|
3848
|
-
More information about the deprecated functionality can be found on the
|
|
3849
|
-
<a href="https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security" target="_blank">Spotify Developer Forum Blog</a>
|
|
3850
|
-
page.
|
|
3851
|
-
</span>
|
|
3852
|
-
|
|
3853
3845
|
Get Spotify catalog information for multiple albums.
|
|
3854
3846
|
|
|
3855
3847
|
Args:
|
|
@@ -3895,37 +3887,42 @@ class SpotifyClient:
|
|
|
3895
3887
|
apiMethodParms.AppendKeyValue("market", market)
|
|
3896
3888
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information for multiple albums", apiMethodParms)
|
|
3897
3889
|
|
|
3898
|
-
# are spotify web player credentials configured? if so, then we will use them to create
|
|
3899
|
-
# an elevated authorization access token for the Spotify Web API endpoint call.
|
|
3900
|
-
accessTokenHeaderValue:str = self._GetSpotifyWebPlayerTokenHeaderValue()
|
|
3901
|
-
|
|
3902
|
-
# if spotify web player credentials not configured then we are done; the Spotify Web API
|
|
3903
|
-
# endpoint is no longer supported by unauthorized Spotify Developer Applications as of 2026/02/11.
|
|
3904
|
-
if (accessTokenHeaderValue is None):
|
|
3905
|
-
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT_20260211 % apiMethodName)
|
|
3906
|
-
|
|
3907
3890
|
# ensure we have a market value, in order to return track relinking (e.g. `linked_from`) data.
|
|
3908
3891
|
market = self._ValidateMarket(market, forceReturnValue=True)
|
|
3909
3892
|
|
|
3910
|
-
#
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
'ids': ids,
|
|
3914
|
-
}
|
|
3915
|
-
if market is not None:
|
|
3916
|
-
urlParms['market'] = market
|
|
3917
|
-
|
|
3918
|
-
# execute spotify web api request.
|
|
3919
|
-
msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/albums')
|
|
3920
|
-
msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
3921
|
-
msg.UrlParameters = urlParms
|
|
3922
|
-
self.MakeRequest('GET', msg)
|
|
3893
|
+
# if ids not specified, then we are done.
|
|
3894
|
+
if (ids is None) or (len(ids.strip()) == 0):
|
|
3895
|
+
raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
|
|
3923
3896
|
|
|
3924
|
-
#
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3897
|
+
# build list of all input item id's, and retrieve them one-by-one.
|
|
3898
|
+
ids = ids.replace(" ", "")
|
|
3899
|
+
arrIds:list[str] = ids.split(',')
|
|
3900
|
+
for strId in arrIds:
|
|
3901
|
+
result.append(self.GetAlbum(strId, market))
|
|
3902
|
+
|
|
3903
|
+
# ------------------------------------------------------------------------------------------
|
|
3904
|
+
# the following is the pre-2026/02/11 endpoint for retrieving this information.
|
|
3905
|
+
# ------------------------------------------------------------------------------------------
|
|
3906
|
+
|
|
3907
|
+
# # build spotify web api request parameters.
|
|
3908
|
+
# urlParms:dict = \
|
|
3909
|
+
# {
|
|
3910
|
+
# 'ids': ids,
|
|
3911
|
+
# }
|
|
3912
|
+
# if market is not None:
|
|
3913
|
+
# urlParms['market'] = market
|
|
3914
|
+
|
|
3915
|
+
# # execute spotify web api request.
|
|
3916
|
+
# msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/albums')
|
|
3917
|
+
# msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
3918
|
+
# msg.UrlParameters = urlParms
|
|
3919
|
+
# self.MakeRequest('GET', msg)
|
|
3920
|
+
|
|
3921
|
+
# # process results.
|
|
3922
|
+
# items = msg.ResponseData.get('albums',None)
|
|
3923
|
+
# if items is not None:
|
|
3924
|
+
# for item in items:
|
|
3925
|
+
# result.append(Album(root=item))
|
|
3929
3926
|
|
|
3930
3927
|
# trace.
|
|
3931
3928
|
_logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[Album]'), result)
|
|
@@ -4842,14 +4839,6 @@ class SpotifyClient:
|
|
|
4842
4839
|
ids:list[str],
|
|
4843
4840
|
) -> list[Artist]:
|
|
4844
4841
|
"""
|
|
4845
|
-
<span class="deprecated">
|
|
4846
|
-
DEPRECATED - api endpoint no longer supported by Spotify as of 2026/02/11 for unauthorized Spotify Developer Applications.
|
|
4847
|
-
The api endpoint IS still supported by Spotify for authorized Spotify Developer Applications.
|
|
4848
|
-
More information about the deprecated functionality can be found on the
|
|
4849
|
-
<a href="https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security" target="_blank">Spotify Developer Forum Blog</a>
|
|
4850
|
-
page.
|
|
4851
|
-
</span>
|
|
4852
|
-
|
|
4853
4842
|
Get Spotify catalog information for several artists based on their Spotify IDs.
|
|
4854
4843
|
|
|
4855
4844
|
Args:
|
|
@@ -4886,32 +4875,37 @@ class SpotifyClient:
|
|
|
4886
4875
|
apiMethodParms.AppendKeyValue("ids", ids)
|
|
4887
4876
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information for multiple artists", apiMethodParms)
|
|
4888
4877
|
|
|
4889
|
-
#
|
|
4890
|
-
|
|
4891
|
-
|
|
4878
|
+
# if ids not specified, then we are done.
|
|
4879
|
+
if (ids is None) or (len(ids.strip()) == 0):
|
|
4880
|
+
raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
|
|
4892
4881
|
|
|
4893
|
-
#
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4882
|
+
# build list of all input item id's, and retrieve them one-by-one.
|
|
4883
|
+
ids = ids.replace(" ", "")
|
|
4884
|
+
arrIds:list[str] = ids.split(',')
|
|
4885
|
+
for strId in arrIds:
|
|
4886
|
+
result.append(self.GetArtist(strId))
|
|
4897
4887
|
|
|
4898
|
-
#
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
'ids': ids
|
|
4902
|
-
}
|
|
4888
|
+
# ------------------------------------------------------------------------------------------
|
|
4889
|
+
# the following is the pre-2026/02/11 endpoint for retrieving this information.
|
|
4890
|
+
# ------------------------------------------------------------------------------------------
|
|
4903
4891
|
|
|
4904
|
-
#
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4892
|
+
# # build spotify web api request parameters.
|
|
4893
|
+
# urlParms:dict = \
|
|
4894
|
+
# {
|
|
4895
|
+
# 'ids': ids
|
|
4896
|
+
# }
|
|
4909
4897
|
|
|
4910
|
-
#
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4898
|
+
# # execute spotify web api request.
|
|
4899
|
+
# msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/artists')
|
|
4900
|
+
# msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
4901
|
+
# msg.UrlParameters = urlParms
|
|
4902
|
+
# self.MakeRequest('GET', msg)
|
|
4903
|
+
|
|
4904
|
+
# # process results.
|
|
4905
|
+
# items = msg.ResponseData.get('artists',None)
|
|
4906
|
+
# if items is not None:
|
|
4907
|
+
# for item in items:
|
|
4908
|
+
# result.append(Artist(root=item))
|
|
4915
4909
|
|
|
4916
4910
|
# trace.
|
|
4917
4911
|
_logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[Artist]'), result)
|
|
@@ -5666,14 +5660,6 @@ class SpotifyClient:
|
|
|
5666
5660
|
market:str=None,
|
|
5667
5661
|
) -> list[AudiobookSimplified]:
|
|
5668
5662
|
"""
|
|
5669
|
-
<span class="deprecated">
|
|
5670
|
-
DEPRECATED - api endpoint no longer supported by Spotify as of 2026/02/11 for unauthorized Spotify Developer Applications.
|
|
5671
|
-
The api endpoint IS still supported by Spotify for authorized Spotify Developer Applications.
|
|
5672
|
-
More information about the deprecated functionality can be found on the
|
|
5673
|
-
<a href="https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security" target="_blank">Spotify Developer Forum Blog</a>
|
|
5674
|
-
page.
|
|
5675
|
-
</span>
|
|
5676
|
-
|
|
5677
5663
|
Get Spotify catalog information for several audiobooks based on their Spotify IDs.
|
|
5678
5664
|
|
|
5679
5665
|
Args:
|
|
@@ -5700,6 +5686,8 @@ class SpotifyClient:
|
|
|
5700
5686
|
SpotifyApiError:
|
|
5701
5687
|
If the method fails for any other reason.
|
|
5702
5688
|
|
|
5689
|
+
Note that `AudiobookSimplified` details do not contain chapter data.
|
|
5690
|
+
|
|
5703
5691
|
Important policy notes:
|
|
5704
5692
|
- Spotify content may not be downloaded.
|
|
5705
5693
|
- Keep visual content in its original form.
|
|
@@ -5724,37 +5712,45 @@ class SpotifyClient:
|
|
|
5724
5712
|
apiMethodParms.AppendKeyValue("market", market)
|
|
5725
5713
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information for multiple audiobooks", apiMethodParms)
|
|
5726
5714
|
|
|
5727
|
-
# are spotify web player credentials configured? if so, then we will use them to create
|
|
5728
|
-
# an elevated authorization access token for the Spotify Web API endpoint call.
|
|
5729
|
-
accessTokenHeaderValue:str = self._GetSpotifyWebPlayerTokenHeaderValue()
|
|
5730
|
-
|
|
5731
|
-
# if spotify web player credentials not configured then we are done; the Spotify Web API
|
|
5732
|
-
# endpoint is no longer supported by unauthorized Spotify Developer Applications as of 2026/02/11.
|
|
5733
|
-
if (accessTokenHeaderValue is None):
|
|
5734
|
-
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT_20260211 % apiMethodName)
|
|
5735
|
-
|
|
5736
5715
|
# ensure market was either supplied or implied; default if neither.
|
|
5737
5716
|
market = self._ValidateMarket(market)
|
|
5738
5717
|
|
|
5739
|
-
#
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
'ids': ids,
|
|
5743
|
-
}
|
|
5744
|
-
if market is not None:
|
|
5745
|
-
urlParms['market'] = market
|
|
5746
|
-
|
|
5747
|
-
# execute spotify web api request.
|
|
5748
|
-
msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/audiobooks')
|
|
5749
|
-
msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
5750
|
-
msg.UrlParameters = urlParms
|
|
5751
|
-
self.MakeRequest('GET', msg)
|
|
5718
|
+
# if ids not specified, then we are done.
|
|
5719
|
+
if (ids is None) or (len(ids.strip()) == 0):
|
|
5720
|
+
raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
|
|
5752
5721
|
|
|
5753
|
-
#
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5722
|
+
# build list of all input item id's, and retrieve them one-by-one.
|
|
5723
|
+
ids = ids.replace(" ", "")
|
|
5724
|
+
arrIds:list[str] = ids.split(',')
|
|
5725
|
+
for strId in arrIds:
|
|
5726
|
+
dataObj = self.GetAudiobook(strId, market)
|
|
5727
|
+
# convert Audiobook object to a AudiobookSimplified object.
|
|
5728
|
+
dataObj._Chapters = None
|
|
5729
|
+
result.append(dataObj)
|
|
5730
|
+
|
|
5731
|
+
# ------------------------------------------------------------------------------------------
|
|
5732
|
+
# the following is the pre-2026/02/11 endpoint for retrieving this information.
|
|
5733
|
+
# ------------------------------------------------------------------------------------------
|
|
5734
|
+
|
|
5735
|
+
# # build spotify web api request parameters.
|
|
5736
|
+
# urlParms:dict = \
|
|
5737
|
+
# {
|
|
5738
|
+
# 'ids': ids,
|
|
5739
|
+
# }
|
|
5740
|
+
# if market is not None:
|
|
5741
|
+
# urlParms['market'] = market
|
|
5742
|
+
|
|
5743
|
+
# # execute spotify web api request.
|
|
5744
|
+
# msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/audiobooks')
|
|
5745
|
+
# msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
5746
|
+
# msg.UrlParameters = urlParms
|
|
5747
|
+
# self.MakeRequest('GET', msg)
|
|
5748
|
+
|
|
5749
|
+
# # process results.
|
|
5750
|
+
# items = msg.ResponseData.get('audiobooks',None)
|
|
5751
|
+
# if items is not None:
|
|
5752
|
+
# for item in items:
|
|
5753
|
+
# result.append(AudiobookSimplified(root=item))
|
|
5758
5754
|
|
|
5759
5755
|
# trace.
|
|
5760
5756
|
_logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[AudiobookSimplified]'), result)
|
|
@@ -6538,14 +6534,6 @@ class SpotifyClient:
|
|
|
6538
6534
|
market:str=None,
|
|
6539
6535
|
) -> list[Chapter]:
|
|
6540
6536
|
"""
|
|
6541
|
-
<span class="deprecated">
|
|
6542
|
-
DEPRECATED - api endpoint no longer supported by Spotify as of 2026/02/11 for unauthorized Spotify Developer Applications.
|
|
6543
|
-
The api endpoint IS still supported by Spotify for authorized Spotify Developer Applications.
|
|
6544
|
-
More information about the deprecated functionality can be found on the
|
|
6545
|
-
<a href="https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security" target="_blank">Spotify Developer Forum Blog</a>
|
|
6546
|
-
page.
|
|
6547
|
-
</span>
|
|
6548
|
-
|
|
6549
6537
|
Get Spotify catalog information for several chapters based on their Spotify IDs.
|
|
6550
6538
|
|
|
6551
6539
|
Args:
|
|
@@ -6596,37 +6584,42 @@ class SpotifyClient:
|
|
|
6596
6584
|
apiMethodParms.AppendKeyValue("market", market)
|
|
6597
6585
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information for multiple chapters", apiMethodParms)
|
|
6598
6586
|
|
|
6599
|
-
# are spotify web player credentials configured? if so, then we will use them to create
|
|
6600
|
-
# an elevated authorization access token for the Spotify Web API endpoint call.
|
|
6601
|
-
accessTokenHeaderValue:str = self._GetSpotifyWebPlayerTokenHeaderValue()
|
|
6602
|
-
|
|
6603
|
-
# if spotify web player credentials not configured then we are done; the Spotify Web API
|
|
6604
|
-
# endpoint is no longer supported by unauthorized Spotify Developer Applications as of 2026/02/11.
|
|
6605
|
-
if (accessTokenHeaderValue is None):
|
|
6606
|
-
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT_20260211 % apiMethodName)
|
|
6607
|
-
|
|
6608
6587
|
# ensure market was either supplied or implied; default if neither.
|
|
6609
6588
|
market = self._ValidateMarket(market)
|
|
6610
6589
|
|
|
6611
|
-
#
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
'ids': ids,
|
|
6615
|
-
}
|
|
6616
|
-
if market is not None:
|
|
6617
|
-
urlParms['market'] = market
|
|
6618
|
-
|
|
6619
|
-
# execute spotify web api request.
|
|
6620
|
-
msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/chapters')
|
|
6621
|
-
msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
6622
|
-
msg.UrlParameters = urlParms
|
|
6623
|
-
self.MakeRequest('GET', msg)
|
|
6590
|
+
# if ids not specified, then we are done.
|
|
6591
|
+
if (ids is None) or (len(ids.strip()) == 0):
|
|
6592
|
+
raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
|
|
6624
6593
|
|
|
6625
|
-
#
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6594
|
+
# build list of all input item id's, and retrieve them one-by-one.
|
|
6595
|
+
ids = ids.replace(" ", "")
|
|
6596
|
+
arrIds:list[str] = ids.split(',')
|
|
6597
|
+
for strId in arrIds:
|
|
6598
|
+
result.append(self.GetChapter(strId, market))
|
|
6599
|
+
|
|
6600
|
+
# ------------------------------------------------------------------------------------------
|
|
6601
|
+
# the following is the pre-2026/02/11 endpoint for retrieving this information.
|
|
6602
|
+
# ------------------------------------------------------------------------------------------
|
|
6603
|
+
|
|
6604
|
+
# # build spotify web api request parameters.
|
|
6605
|
+
# urlParms:dict = \
|
|
6606
|
+
# {
|
|
6607
|
+
# 'ids': ids,
|
|
6608
|
+
# }
|
|
6609
|
+
# if market is not None:
|
|
6610
|
+
# urlParms['market'] = market
|
|
6611
|
+
|
|
6612
|
+
# # execute spotify web api request.
|
|
6613
|
+
# msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/chapters')
|
|
6614
|
+
# msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
6615
|
+
# msg.UrlParameters = urlParms
|
|
6616
|
+
# self.MakeRequest('GET', msg)
|
|
6617
|
+
|
|
6618
|
+
# # process results.
|
|
6619
|
+
# items = msg.ResponseData.get('chapters',None)
|
|
6620
|
+
# if items is not None:
|
|
6621
|
+
# for item in items:
|
|
6622
|
+
# result.append(Chapter(root=item))
|
|
6630
6623
|
|
|
6631
6624
|
# trace.
|
|
6632
6625
|
_logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[Chapter]'), result)
|
|
@@ -7157,14 +7150,6 @@ class SpotifyClient:
|
|
|
7157
7150
|
market:str=None,
|
|
7158
7151
|
) -> list[Episode]:
|
|
7159
7152
|
"""
|
|
7160
|
-
<span class="deprecated">
|
|
7161
|
-
DEPRECATED - api endpoint no longer supported by Spotify as of 2026/02/11 for unauthorized Spotify Developer Applications.
|
|
7162
|
-
The api endpoint IS still supported by Spotify for authorized Spotify Developer Applications.
|
|
7163
|
-
More information about the deprecated functionality can be found on the
|
|
7164
|
-
<a href="https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security" target="_blank">Spotify Developer Forum Blog</a>
|
|
7165
|
-
page.
|
|
7166
|
-
</span>
|
|
7167
|
-
|
|
7168
7153
|
Get Spotify catalog information for several episodes based on their Spotify IDs.
|
|
7169
7154
|
|
|
7170
7155
|
Args:
|
|
@@ -7215,37 +7200,42 @@ class SpotifyClient:
|
|
|
7215
7200
|
apiMethodParms.AppendKeyValue("market", market)
|
|
7216
7201
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information for multiple episodes", apiMethodParms)
|
|
7217
7202
|
|
|
7218
|
-
# are spotify web player credentials configured? if so, then we will use them to create
|
|
7219
|
-
# an elevated authorization access token for the Spotify Web API endpoint call.
|
|
7220
|
-
accessTokenHeaderValue:str = self._GetSpotifyWebPlayerTokenHeaderValue()
|
|
7221
|
-
|
|
7222
|
-
# if spotify web player credentials not configured then we are done; the Spotify Web API
|
|
7223
|
-
# endpoint is no longer supported by unauthorized Spotify Developer Applications as of 2026/02/11.
|
|
7224
|
-
if (accessTokenHeaderValue is None):
|
|
7225
|
-
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT_20260211 % apiMethodName)
|
|
7226
|
-
|
|
7227
7203
|
# ensure market was either supplied or implied; default if neither.
|
|
7228
7204
|
market = self._ValidateMarket(market)
|
|
7229
7205
|
|
|
7230
|
-
#
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
'ids': ids,
|
|
7234
|
-
}
|
|
7235
|
-
if market is not None:
|
|
7236
|
-
urlParms['market'] = market
|
|
7237
|
-
|
|
7238
|
-
# execute spotify web api request.
|
|
7239
|
-
msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/episodes')
|
|
7240
|
-
msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
7241
|
-
msg.UrlParameters = urlParms
|
|
7242
|
-
self.MakeRequest('GET', msg)
|
|
7206
|
+
# if ids not specified, then we are done.
|
|
7207
|
+
if (ids is None) or (len(ids.strip()) == 0):
|
|
7208
|
+
raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
|
|
7243
7209
|
|
|
7244
|
-
#
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7210
|
+
# build list of all input item id's, and retrieve them one-by-one.
|
|
7211
|
+
ids = ids.replace(" ", "")
|
|
7212
|
+
arrIds:list[str] = ids.split(',')
|
|
7213
|
+
for strId in arrIds:
|
|
7214
|
+
result.append(self.GetEpisode(strId, market))
|
|
7215
|
+
|
|
7216
|
+
# ------------------------------------------------------------------------------------------
|
|
7217
|
+
# the following is the pre-2026/02/11 endpoint for retrieving this information.
|
|
7218
|
+
# ------------------------------------------------------------------------------------------
|
|
7219
|
+
|
|
7220
|
+
# # build spotify web api request parameters.
|
|
7221
|
+
# urlParms:dict = \
|
|
7222
|
+
# {
|
|
7223
|
+
# 'ids': ids,
|
|
7224
|
+
# }
|
|
7225
|
+
# if market is not None:
|
|
7226
|
+
# urlParms['market'] = market
|
|
7227
|
+
|
|
7228
|
+
# # execute spotify web api request.
|
|
7229
|
+
# msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/episodes')
|
|
7230
|
+
# msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
7231
|
+
# msg.UrlParameters = urlParms
|
|
7232
|
+
# self.MakeRequest('GET', msg)
|
|
7233
|
+
|
|
7234
|
+
# # process results.
|
|
7235
|
+
# items = msg.ResponseData.get('episodes',None)
|
|
7236
|
+
# if items is not None:
|
|
7237
|
+
# for item in items:
|
|
7238
|
+
# result.append(Episode(root=item))
|
|
7249
7239
|
|
|
7250
7240
|
# trace.
|
|
7251
7241
|
_logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[Episode]'), result)
|
|
@@ -10525,14 +10515,6 @@ class SpotifyClient:
|
|
|
10525
10515
|
market:str=None,
|
|
10526
10516
|
) -> list[ShowSimplified]:
|
|
10527
10517
|
"""
|
|
10528
|
-
<span class="deprecated">
|
|
10529
|
-
DEPRECATED - api endpoint no longer supported by Spotify as of 2026/02/11 for unauthorized Spotify Developer Applications.
|
|
10530
|
-
The api endpoint IS still supported by Spotify for authorized Spotify Developer Applications.
|
|
10531
|
-
More information about the deprecated functionality can be found on the
|
|
10532
|
-
<a href="https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security" target="_blank">Spotify Developer Forum Blog</a>
|
|
10533
|
-
page.
|
|
10534
|
-
</span>
|
|
10535
|
-
|
|
10536
10518
|
Get Spotify catalog information for several shows based on their Spotify IDs.
|
|
10537
10519
|
|
|
10538
10520
|
Args:
|
|
@@ -10559,6 +10541,8 @@ class SpotifyClient:
|
|
|
10559
10541
|
SpotifyApiError:
|
|
10560
10542
|
If the method fails for any other reason.
|
|
10561
10543
|
|
|
10544
|
+
Note that `ShowSimplified` details do not contain episode data.
|
|
10545
|
+
|
|
10562
10546
|
Important policy notes:
|
|
10563
10547
|
- Spotify content may not be downloaded.
|
|
10564
10548
|
- Keep visual content in its original form.
|
|
@@ -10583,37 +10567,45 @@ class SpotifyClient:
|
|
|
10583
10567
|
apiMethodParms.AppendKeyValue("market", market)
|
|
10584
10568
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information for multiple shows", apiMethodParms)
|
|
10585
10569
|
|
|
10586
|
-
# are spotify web player credentials configured? if so, then we will use them to create
|
|
10587
|
-
# an elevated authorization access token for the Spotify Web API endpoint call.
|
|
10588
|
-
accessTokenHeaderValue:str = self._GetSpotifyWebPlayerTokenHeaderValue()
|
|
10589
|
-
|
|
10590
|
-
# if spotify web player credentials not configured then we are done; the Spotify Web API
|
|
10591
|
-
# endpoint is no longer supported by unauthorized Spotify Developer Applications as of 2026/02/11.
|
|
10592
|
-
if (accessTokenHeaderValue is None):
|
|
10593
|
-
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT_20260211 % apiMethodName)
|
|
10594
|
-
|
|
10595
10570
|
# ensure market was either supplied or implied; default if neither.
|
|
10596
10571
|
market = self._ValidateMarket(market)
|
|
10597
10572
|
|
|
10598
|
-
#
|
|
10599
|
-
|
|
10600
|
-
|
|
10601
|
-
'ids': ids,
|
|
10602
|
-
}
|
|
10603
|
-
if market is not None:
|
|
10604
|
-
urlParms['market'] = market
|
|
10605
|
-
|
|
10606
|
-
# execute spotify web api request.
|
|
10607
|
-
msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/shows')
|
|
10608
|
-
msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
10609
|
-
msg.UrlParameters = urlParms
|
|
10610
|
-
self.MakeRequest('GET', msg)
|
|
10573
|
+
# if ids not specified, then we are done.
|
|
10574
|
+
if (ids is None) or (len(ids.strip()) == 0):
|
|
10575
|
+
raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
|
|
10611
10576
|
|
|
10612
|
-
#
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10577
|
+
# build list of all input item id's, and retrieve them one-by-one.
|
|
10578
|
+
ids = ids.replace(" ", "")
|
|
10579
|
+
arrIds:list[str] = ids.split(',')
|
|
10580
|
+
for strId in arrIds:
|
|
10581
|
+
dataObj = self.GetShow(strId, market)
|
|
10582
|
+
# convert Show object to a ShowSimplified object.
|
|
10583
|
+
dataObj._Episodes = None
|
|
10584
|
+
result.append(dataObj)
|
|
10585
|
+
|
|
10586
|
+
# ------------------------------------------------------------------------------------------
|
|
10587
|
+
# the following is the pre-2026/02/11 endpoint for retrieving this information.
|
|
10588
|
+
# ------------------------------------------------------------------------------------------
|
|
10589
|
+
|
|
10590
|
+
# # build spotify web api request parameters.
|
|
10591
|
+
# urlParms:dict = \
|
|
10592
|
+
# {
|
|
10593
|
+
# 'ids': ids,
|
|
10594
|
+
# }
|
|
10595
|
+
# if market is not None:
|
|
10596
|
+
# urlParms['market'] = market
|
|
10597
|
+
|
|
10598
|
+
# # execute spotify web api request.
|
|
10599
|
+
# msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/shows')
|
|
10600
|
+
# msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
10601
|
+
# msg.UrlParameters = urlParms
|
|
10602
|
+
# self.MakeRequest('GET', msg)
|
|
10603
|
+
|
|
10604
|
+
# # process results.
|
|
10605
|
+
# items = msg.ResponseData.get('shows',None)
|
|
10606
|
+
# if items is not None:
|
|
10607
|
+
# for item in items:
|
|
10608
|
+
# result.append(ShowSimplified(root=item))
|
|
10617
10609
|
|
|
10618
10610
|
# trace.
|
|
10619
10611
|
_logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[ShowSimplified]'), result)
|
|
@@ -11524,14 +11516,6 @@ class SpotifyClient:
|
|
|
11524
11516
|
market:str=None,
|
|
11525
11517
|
) -> list[Track]:
|
|
11526
11518
|
"""
|
|
11527
|
-
<span class="deprecated">
|
|
11528
|
-
DEPRECATED - api endpoint no longer supported by Spotify as of 2026/02/11 for unauthorized Spotify Developer Applications.
|
|
11529
|
-
The api endpoint IS still supported by Spotify for authorized Spotify Developer Applications.
|
|
11530
|
-
More information about the deprecated functionality can be found on the
|
|
11531
|
-
<a href="https://developer.spotify.com/blog/2026-02-06-update-on-developer-access-and-platform-security" target="_blank">Spotify Developer Forum Blog</a>
|
|
11532
|
-
page.
|
|
11533
|
-
</span>
|
|
11534
|
-
|
|
11535
11519
|
Get Spotify catalog information for multiple tracks based on their Spotify IDs.
|
|
11536
11520
|
|
|
11537
11521
|
Args:
|
|
@@ -11577,37 +11561,42 @@ class SpotifyClient:
|
|
|
11577
11561
|
apiMethodParms.AppendKeyValue("market", market)
|
|
11578
11562
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information for multiple tracks", apiMethodParms)
|
|
11579
11563
|
|
|
11580
|
-
# are spotify web player credentials configured? if so, then we will use them to create
|
|
11581
|
-
# an elevated authorization access token for the Spotify Web API endpoint call.
|
|
11582
|
-
accessTokenHeaderValue:str = self._GetSpotifyWebPlayerTokenHeaderValue()
|
|
11583
|
-
|
|
11584
|
-
# if spotify web player credentials not configured then we are done; the Spotify Web API
|
|
11585
|
-
# endpoint is no longer supported by unauthorized Spotify Developer Applications as of 2026/02/11.
|
|
11586
|
-
if (accessTokenHeaderValue is None):
|
|
11587
|
-
raise SpotifyApiError(SAAppMessages.MSG_SPOTIFY_DEPRECATED_ENDPOINT_20260211 % apiMethodName)
|
|
11588
|
-
|
|
11589
11564
|
# ensure we have a market value, in order to return track relinking (e.g. `linked_from`) data.
|
|
11590
11565
|
market = self._ValidateMarket(market, forceReturnValue=True)
|
|
11591
11566
|
|
|
11592
|
-
#
|
|
11593
|
-
|
|
11594
|
-
|
|
11595
|
-
'ids': ids
|
|
11596
|
-
}
|
|
11597
|
-
if market is not None:
|
|
11598
|
-
urlParms['market'] = market
|
|
11599
|
-
|
|
11600
|
-
# execute spotify web api request.
|
|
11601
|
-
msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/tracks')
|
|
11602
|
-
msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
11603
|
-
msg.UrlParameters = urlParms
|
|
11604
|
-
self.MakeRequest('GET', msg)
|
|
11567
|
+
# if ids not specified, then we are done.
|
|
11568
|
+
if (ids is None) or (len(ids.strip()) == 0):
|
|
11569
|
+
raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
|
|
11605
11570
|
|
|
11606
|
-
#
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11571
|
+
# build list of all input item id's, and retrieve them one-by-one.
|
|
11572
|
+
ids = ids.replace(" ", "")
|
|
11573
|
+
arrIds:list[str] = ids.split(',')
|
|
11574
|
+
for strId in arrIds:
|
|
11575
|
+
result.append(self.GetTrack(strId, market))
|
|
11576
|
+
|
|
11577
|
+
# ------------------------------------------------------------------------------------------
|
|
11578
|
+
# the following is the pre-2026/02/11 endpoint for retrieving this information.
|
|
11579
|
+
# ------------------------------------------------------------------------------------------
|
|
11580
|
+
|
|
11581
|
+
# # build spotify web api request parameters.
|
|
11582
|
+
# urlParms:dict = \
|
|
11583
|
+
# {
|
|
11584
|
+
# 'ids': ids
|
|
11585
|
+
# }
|
|
11586
|
+
# if market is not None:
|
|
11587
|
+
# urlParms['market'] = market
|
|
11588
|
+
|
|
11589
|
+
# # execute spotify web api request.
|
|
11590
|
+
# msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/tracks')
|
|
11591
|
+
# msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
|
|
11592
|
+
# msg.UrlParameters = urlParms
|
|
11593
|
+
# self.MakeRequest('GET', msg)
|
|
11594
|
+
|
|
11595
|
+
# # process results.
|
|
11596
|
+
# items = msg.ResponseData.get('tracks',None)
|
|
11597
|
+
# if items is not None:
|
|
11598
|
+
# for item in items:
|
|
11599
|
+
# result.append(Track(root=item))
|
|
11611
11600
|
|
|
11612
11601
|
# trace.
|
|
11613
11602
|
_logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[Track]'), result)
|