mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-10-10 17:00:46 +00:00
Fix
This commit is contained in:
1 parent
14268a8a2c
commit
60f530842d
1 file changed
+6
-4
@@ -5,13 +5,15 @@ from pprint import pprint
|
||||
sp = spotipy.Spotify(client_credentials_manager=SpotifyClientCredentials())
|
||||
|
||||
pl_id = 'spotify:playlist:5RIbzhG2QqdkaP24iXLnZX'
|
||||
response = sp.playlist_tracks(pl_id, fields='items.track.id,total')
|
||||
offset = 0
|
||||
|
||||
while len(response['items']) > 0:
|
||||
print(offset, "/", response['total'])
|
||||
while True:
|
||||
response = sp.playlist_tracks(pl_id,
|
||||
offset=offset,
|
||||
fields='items.track.id,total')
|
||||
offset = offset + len(response['items'])
|
||||
pprint(response['items'])
|
||||
offset = offset + len(response['items'])
|
||||
print(offset, "/", response['total'])
|
||||
|
||||
if len(response['items']) == 0:
|
||||
break
|
||||
Reference in new issue
Block a user