我正在使用點數來獲取播放列表的列表。我用 if token:
sp = spotipy.Spotify(auth=token)
playlists = sp.user_playlists(username)
for item in playlists['items']:
id= item['uri']
print id
這將返回看起來像 Spotify的播放列表的UR
編寫腳本Spotipy從給定的專輯,我偶爾發現了錯誤返回專輯曲目: album_id = results["albums"]["items"][0]["uri"]
IndexError: list index out of range
錯誤往往出現更多的當紅藝人遍歷所有的他們的專輯。我猜測結果列表已經達到了極限,或者它以某種方式失序。無論哪種方式,我不知道如何解決它,因爲我很確定我從Spot