PS D:\dls> python spot.py
🎧 Downloading from: https://open.spotify.com/artist/0wxonuu6PI1TwJPveIbvDM

▶️ Attempt 1/3
Processing query: https://open.spotify.com/artist/0wxonuu6PI1TwJPveIbvDM
Found 16 songs in Outrun The Gun (Artist)
Overwriting Outrun The Gun - The Way Out  (duplicate)
Removing duplicate file: D:\DLs\Spotify Downloads\Outrun The Gun - The Way
Out.m4a
AudioProviderError: YT-DLP download error -
https://music.youtube.com/watch?v=TqjPRlghdb4
Downloaded "Outrun The Gun - The World to Come":
https://music.youtube.com/watch?v=TcU882EL8fI
Downloaded "Outrun The Gun - Under the Skin":
https://music.youtube.com/watch?v=VvJ2q4ynQkw
Downloaded "Outrun The Gun - The Echo of a Voice":
https://music.youtube.com/watch?v=TYXF1grBJLU
Overwriting Outrun The Gun - The Lost Chapter  (duplicate)
Removing duplicate file: D:\DLs\Spotify Downloads\Outrun The Gun - The Lost
Chapter.m4a
Downloaded "Outrun The Gun - Words of Hope":
https://music.youtube.com/watch?v=HeBcYH35GoI
Downloaded "Outrun The Gun - The Lost Chapter":
https://music.youtube.com/watch?v=cW2jXn0UaYc
Downloaded "Outrun The Gun - It's Too Quiet in Here":
https://music.youtube.com/watch?v=_cMhmcDQuKM
Downloaded "Outrun The Gun - The Multitude (Pt. 1: The Awakening)":
https://www.youtube.com/watch?v=zRCF6UeRAus
Downloaded "Outrun The Gun - You and Me Til the End":
https://music.youtube.com/watch?v=DBWsSkgWwMs
AudioProviderError: YT-DLP download error -
https://music.youtube.com/watch?v=ZeOD39ODXVg
Downloaded "Outrun The Gun - An Orison":
https://music.youtube.com/watch?v=of00hvUhJsc
AudioProviderError: YT-DLP download error -
https://music.youtube.com/watch?v=wdmVHlw3agE
AudioProviderError: YT-DLP download error -
https://music.youtube.com/watch?v=xUqPhHiuFp8
Downloaded "Outrun The Gun - The Theologian":
https://music.youtube.com/watch?v=slqWGCBhs48
Downloaded "Outrun The Gun - Fear of Sleep":
https://music.youtube.com/watch?v=ox3MeEc2IdQ
Downloaded "Outrun The Gun - Starter Home":
https://music.youtube.com/watch?v=ApfBRpAS108


✅ Download complete.
PS D:\dls>

this DIDNT give me a reason for why it errored

import subprocess
import pathlib
import time
import sys

# === SETTINGS ===
SPOTDL_EXE = pathlib.Path(r"D:\DLs\spotdl.exe")
OUT_DIR = pathlib.Path(r"D:\DLs\Spotify Downloads")
OUT_DIR.mkdir(parents=True, exist_ok=True)

MAX_RETRIES = 3
RETRY_DELAY = 5  # seconds between retries
SPOTIFY_LINK = "https://open.spotify.com/artist/0wxonuu6PI1TwJPveIbvDM"

def run_download(spotify_link: str):
    print(f"🎧 Downloading from: {spotify_link}")

    cmd = [
        str(SPOTDL_EXE),
        "download",
        spotify_link,
        "--output", str(OUT_DIR),
        "--format", "m4a",
        "--bitrate", "320k",
        "--overwrite", "force",  # forcibly overwrite existing files
        "--yt-dlp-args", "-f bestaudio"  # ensure yt-dlp fetches best quality audio
    ]

    for attempt in range(1, MAX_RETRIES + 1):
        print(f"\n▶️ Attempt {attempt}/{MAX_RETRIES}")
        try:
            result = subprocess.run(cmd, capture_output=True, text=True, check=True)
            print(result.stdout)
            print("✅ Download complete.")
            return
        except subprocess.CalledProcessError as e:
            print(f"❌ Attempt {attempt} failed.")
            print("🧾 STDERR Output:\n" + e.stderr.strip())

            # Detect common causes
            if "YT-DLP download error" in e.stderr:
                print("\n⚠️ Detected yt-dlp YouTube Music download issue.")
                print("💡 Suggestions:")
                print("- Ensure your internet connection is stable.")
                print("- Update yt-dlp: run `spotdl --download-ffmpeg` or update yt-dlp.exe manually.")
                print("- Not all songs may be available on YouTube Music (geo-blocked, removed, or private).")

            if attempt < MAX_RETRIES:
                print(f"⏳ Retrying in {RETRY_DELAY} seconds...")
                time.sleep(RETRY_DELAY)
            else:
                print("\n🚫 All retry attempts failed. Some tracks were not downloaded.")


def main():
    if not SPOTIFY_LINK.startswith("https://open.spotify.com/"):
        print("⚠️ Invalid Spotify link. Must start with 'https://open.spotify.com/'")
        sys.exit(1)

    run_download(SPOTIFY_LINK)


if __name__ == "__main__":
    main()