mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Fix
This commit is contained in:
parent
14268a8a2c
commit
60f530842d
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user