Prepare V0.2

This commit is contained in:
unknown
2025-12-18 05:21:09 +01:00
parent e0ab8ff1f4
commit 94e2ca7813

View File

@@ -17,6 +17,9 @@ import uuid
import json import json
import ffmpy 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: def get_saved_tracks() -> list:
songs = [] songs = []
offset = 0 offset = 0
@@ -346,8 +349,16 @@ def download_track(mode: str, track_id: str, extra_keys=None, disable_progressba
else: else:
Printer.print(PrintChannel.PROGRESS_INFO, '\n### STARTING "' + song_name + '" ###' + "\n") Printer.print(PrintChannel.PROGRESS_INFO, '\n### STARTING "' + song_name + '" ###' + "\n")
if ext == 'ogg': if ext == 'ogg':
Printer.print(PrintChannel.PROGRESS_INFO, '\n## OGG File : Waiting 5 seconds before resuming... ##') # SpotiClub : TEMP? : For albums/playlists, wait 5 seconds between OGG tracks to avoid
time.sleep(5); # 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: if track_id != scraped_song_id:
track_id = scraped_song_id track_id = scraped_song_id
track = TrackId.from_base62(track_id) track = TrackId.from_base62(track_id)