From b9c2a9f66381dfa964b6ec1fa0589639d8b0cc3d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 6 Sep 2023 03:04:29 +0200 Subject: [PATCH] break when no more songs --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index 5aface7..3598f4f 100644 --- a/main.py +++ b/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'])