From 94e2ca7813e58601f013b30d5543f6f4a7531f96 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Dec 2025 05:21:09 +0100 Subject: [PATCH] Prepare V0.2 --- zotify/track.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/zotify/track.py b/zotify/track.py index aae5a7d..7a12e2c 100644 --- a/zotify/track.py +++ b/zotify/track.py @@ -17,6 +17,9 @@ import uuid import json import ffmpy +# Track whether we've already applied the OGG delay for bulk (album/playlist) downloads +_ogg_delay_applied_once = False + def get_saved_tracks() -> list: songs = [] offset = 0 @@ -346,8 +349,16 @@ def download_track(mode: str, track_id: str, extra_keys=None, disable_progressba else: Printer.print(PrintChannel.PROGRESS_INFO, '\n### STARTING "' + song_name + '" ###' + "\n") if ext == 'ogg': - Printer.print(PrintChannel.PROGRESS_INFO, '\n## OGG File : Waiting 5 seconds before resuming... ##') - time.sleep(5); + # SpotiClub : TEMP? : For albums/playlists, wait 5 seconds between OGG tracks to avoid + # spamming the SpotiClub API for audio keys. + # Skip the very first track in the run and for single-track downloads. + global _ogg_delay_applied_once + if mode in ('album', 'playlist', 'extplaylist'): + if _ogg_delay_applied_once: + Printer.print(PrintChannel.PROGRESS_INFO, '\n## OGG File : Waiting 5 seconds before resuming... ##') + time.sleep(5) + else: + _ogg_delay_applied_once = True if track_id != scraped_song_id: track_id = scraped_song_id track = TrackId.from_base62(track_id)