i dont have time for this

This commit is contained in:
architect.in.git
2025-04-22 21:51:06 -06:00
parent b00115792a
commit dbbd8889df
8 changed files with 208 additions and 36 deletions

View File

@@ -6,7 +6,6 @@ from deezspot.deezloader import DeeLogin
from pathlib import Path
def download_playlist(
service,
url,
main,
fallback=None,
@@ -22,8 +21,24 @@ def download_playlist(
progress_callback=None,
):
try:
# DEBUG: Print parameters
print(f"DEBUG: playlist.py received - service={service}, main={main}, fallback={fallback}")
# Detect URL source (Spotify or Deezer) from URL
is_spotify_url = 'open.spotify.com' in url.lower()
is_deezer_url = 'deezer.com' in url.lower()
# Determine service exclusively from URL
if is_spotify_url:
service = 'spotify'
elif is_deezer_url:
service = 'deezer'
else:
# If URL can't be detected, raise an error
error_msg = "Invalid URL: Must be from open.spotify.com or deezer.com"
print(f"ERROR: {error_msg}")
raise ValueError(error_msg)
print(f"DEBUG: playlist.py - URL detection: is_spotify_url={is_spotify_url}, is_deezer_url={is_deezer_url}")
print(f"DEBUG: playlist.py - Service determined from URL: {service}")
print(f"DEBUG: playlist.py - Credentials: main={main}, fallback={fallback}")
# Load Spotify client credentials if available
spotify_client_id = None
@@ -49,6 +64,8 @@ def download_playlist(
except Exception as e:
print(f"Error loading Spotify search credentials: {e}")
# For Spotify URLs: check if fallback is enabled, if so use the fallback logic,
# otherwise download directly from Spotify
if service == 'spotify':
if fallback:
if quality is None:
@@ -181,6 +198,7 @@ def download_playlist(
max_retries=max_retries
)
print(f"DEBUG: Playlist download completed successfully using Spotify main")
# For Deezer URLs: download directly from Deezer
elif service == 'deezer':
if quality is None:
quality = 'FLAC'