break when no more songs
This commit is contained in:
parent
245c437237
commit
b9c2a9f663
1 changed files with 4 additions and 0 deletions
4
main.py
4
main.py
|
@ -28,6 +28,10 @@ while True:
|
|||
else:
|
||||
offset += limit
|
||||
|
||||
# Break the loop if we reach the end
|
||||
if len(results['items']) == 0:
|
||||
break
|
||||
|
||||
saved_tracks.extend(results['items'])
|
||||
|
||||
|
||||
|
|
Reference in a new issue