spotify-downloader: SpotDL 4.1.4 stops abruptly with errors at the 38% mark in the middle of playlist

System OS

Windows

Python Version

3.11 (CPython)

Install Source

pip / PyPi

Install version / commit hash

4.1.3, 4.1.4

Expected Behavior vs Actual Behavior

SpotDL stops abruptly with errors at the 38% mark while downloading the following playlist in Windows: https://music.youtube.com/playlist?list=PLgeWE9wvSRs7QkgMxXMEMKENilgNzQrRl

┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ C:\Program Files\Python311\Lib\site-packages\spotdl\download\downloader.py:383 in search_and_download               │
│                                                                                                                     │
│   380 │   │   reinitialized = False                                                                                 │
│   381 │   │   try:                                                                                                  │
│   382 │   │   │   # Create the output file path                                                                     │
│ > 383 │   │   │   output_file = create_file_name(                                                                   │
│   384 │   │   │   │   song,                                                                                         │
│   385 │   │   │   │   self.settings["output"],                                                                      │
│   386 │   │   │   │   self.settings["format"],                                                                      │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\formatter.py:318 in create_file_name                      │
│                                                                                                                     │
│   315 │   if not template.endswith(".{output-ext}"):                                                                │
│   316 │   │   template += ".{output-ext}"                                                                           │
│   317 │                                                                                                             │
│ > 318 │   formatted_string = format_query(                                                                          │
│   319 │   │   song=song,                                                                                            │
│   320 │   │   template=template,                                                                                    │
│   321 │   │   santitize=True,                                                                                       │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\formatter.py:222 in format_query                          │
│                                                                                                                     │
│   219 │   │   "{artist}": song.artists[0],                                                                          │
│   220 │   │   "{album}": song.album_name,                                                                           │
│   221 │   │   "{album-artist}": song.album_artist,                                                                  │
│ > 222 │   │   "{genre}": song.genres[0] if len(song.genres) > 0 else "",                                            │
│   223 │   │   "{disc-number}": song.disc_number,                                                                    │
│   224 │   │   "{disc-count}": song.disc_count,                                                                      │
│   225 │   │   "{duration}": song.duration,                                                                          │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
TypeError: object of type 'NoneType' has no len()

During handling of the above exception, another exception occurred:

┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ C:\Program Files\Python311\Lib\site-packages\spotdl\console\entry_point.py:120 in console_entry_point               │
│                                                                                                                     │
│   117 │   try:                                                                                                      │
│   118 │   │   # Pick the operation to perform                                                                       │
│   119 │   │   # based on the name and run it!                                                                       │
│ > 120 │   │   OPERATIONS[arguments.operation](                                                                      │
│   121 │   │   │   query=arguments.query,                                                                            │
│   122 │   │   │   downloader=downloader,                                                                            │
│   123 │   │   )                                                                                                     │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\console\download.py:28 in download                              │
│                                                                                                                     │
│   25 │   songs = get_simple_songs(query, use_ytm_data=downloader.settings["ytm_data"])                              │
│   26 │                                                                                                              │
│   27 │   # Download the songs                                                                                       │
│ > 28 │   downloader.download_multiple_songs(songs)                                                                  │
│   29                                                                                                                │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\download\downloader.py:253 in download_multiple_songs           │
│                                                                                                                     │
│   250 │   │   tasks = [self.pool_download(song) for song in songs]                                                  │
│   251 │   │                                                                                                         │
│   252 │   │   # Call all task asynchronously, and wait until all are finished                                       │
│ > 253 │   │   results = list(self.loop.run_until_complete(asyncio.gather(*tasks)))                                  │
│   254 │   │                                                                                                         │
│   255 │   │   # Print errors                                                                                        │
│   256 │   │   if self.settings["print_errors"]:                                                                     │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\asyncio\base_events.py:653 in run_until_complete                                     │
│                                                                                                                     │
│    650 │   │   if not future.done():                                                                                │
│    651 │   │   │   raise RuntimeError('Event loop stopped before Future completed.')                                │
│    652 │   │                                                                                                        │
│ >  653 │   │   return future.result()                                                                               │
│    654 │                                                                                                            │
│    655 │   def stop(self):                                                                                          │
│    656 │   │   """Stop running the event loop.                                                                      │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\download\downloader.py:316 in pool_download                     │
│                                                                                                                     │
│   313 │   │   # tasks that cannot acquire semaphore will wait here until it's free                                  │
│   314 │   │   # only certain amount of tasks can acquire the semaphore at the same time                             │
│   315 │   │   async with self.semaphore:                                                                            │
│ > 316 │   │   │   return await self.loop.run_in_executor(None, self.search_and_download, song)                      │
│   317 │                                                                                                             │
│   318 │   def search(self, song: Song) -> str:                                                                      │
│   319 │   │   """                                                                                                   │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\concurrent\futures\thread.py:58 in run                                               │
│                                                                                                                     │
│    55 │   │   │   return                                                                                            │
│    56 │   │                                                                                                         │
│    57 │   │   try:                                                                                                  │
│ >  58 │   │   │   result = self.fn(*self.args, **self.kwargs)                                                       │
│    59 │   │   except BaseException as exc:                                                                          │
│    60 │   │   │   self.future.set_exception(exc)                                                                    │
│    61 │   │   │   # Break a reference cycle with the exception 'exc'                                                │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\download\downloader.py:390 in search_and_download               │
│                                                                                                                     │
│   387 │   │   │   │   self.settings["restrict"],                                                                    │
│   388 │   │   │   )                                                                                                 │
│   389 │   │   except Exception:                                                                                     │
│ > 390 │   │   │   song = reinit_song(song)                                                                          │
│   391 │   │   │   output_file = create_file_name(                                                                   │
│   392 │   │   │   │   song,                                                                                         │
│   393 │   │   │   │   self.settings["output"],                                                                      │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\search.py:271 in reinit_song                              │
│                                                                                                                     │
│   268 │   if data.get("url"):                                                                                       │
│   269 │   │   new_data = Song.from_url(data["url"]).json                                                            │
│   270 │   elif data.get("name") and data.get("artist"):                                                             │
│ > 271 │   │   new_data = Song.from_search_term(data["name"]).json                                                   │
│   272 │   else:                                                                                                     │
│   273 │   │   raise QueryError("Song object is missing required data to be reinitialized")                          │
│   274                                                                                                               │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\types\song.py:162 in from_search_term                           │
│                                                                                                                     │
│   159 │   │   raw_search_results = Song.search(search_term)                                                         │
│   160 │   │                                                                                                         │
│   161 │   │   if len(raw_search_results["tracks"]["items"]) == 0:                                                   │
│ > 162 │   │   │   raise SongError(f"No results found for: {search_term}")                                           │
│   163 │   │                                                                                                         │
│   164 │   │   return Song.from_url(                                                                                 │
│   165 │   │   │   "http://open.spotify.com/track/"                                                                  │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Steps to reproduce - Ensure to include actual links!

The issue can be reproduced by trying to download the following playlist via spotDL 4.1.3 in Windows [py-3.11.2]: https://music.youtube.com/playlist?list=PLgeWE9wvSRs7QkgMxXMEMKENilgNzQrRl

I also tried this in a new Windows VM just to be sure, & new installation of Python and SpotDL+ffmpeg. The errors are faithfully reproduced right at the 38% mark.

The full log is attached in the following text file. a.error.txt

Additionally, I also tried running the following upgrade command to check if issue has already been fixed in the dev branch. pip install --force -U https://codeload.github.com/spotDL/spotify-downloader/zip/dev

The issue persists.

Traceback

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Windows\system32> python --version
Python 3.11.2
PS C:\Windows\system32> pip install spotdl
Collecting spotdl
  Using cached spotdl-4.1.3-py3-none-any.whl (94 kB)
Requirement already satisfied: beautifulsoup4<5.0.0,>=4.11.2 in c:\program files\python311\lib\site-packages (from spotdl) (4.12.0)
Requirement already satisfied: fastapi<0.90.0,>=0.89.1 in c:\program files\python311\lib\site-packages (from spotdl) (0.89.1)
Requirement already satisfied: mutagen<2.0.0,>=1.46.0 in c:\program files\python311\lib\site-packages (from spotdl) (1.46.0)
Requirement already satisfied: platformdirs<3.0.0,>=2.6.2 in c:\program files\python311\lib\site-packages (from spotdl) (2.6.2)
Requirement already satisfied: pydantic<2.0.0,>=1.10.5 in c:\program files\python311\lib\site-packages (from spotdl) (1.10.7)
Requirement already satisfied: pykakasi<3.0.0,>=2.2.1 in c:\program files\python311\lib\site-packages (from spotdl) (2.2.1)
Requirement already satisfied: python-slugify[unidecode]<9.0.0,>=8.0.1 in c:\program files\python311\lib\site-packages (from spotdl) (8.0.1)
Requirement already satisfied: pytube<13.0.0,>=12.1.2 in c:\program files\python311\lib\site-packages (from spotdl) (12.1.2)
Requirement already satisfied: rapidfuzz<3.0.0,>=2.13.7 in c:\program files\python311\lib\site-packages (from spotdl) (2.13.7)
Requirement already satisfied: requests<3.0.0,>=2.28.2 in c:\program files\python311\lib\site-packages (from spotdl) (2.28.2)
Requirement already satisfied: rich<14.0.0,>=13.3.1 in c:\program files\python311\lib\site-packages (from spotdl) (13.3.2)
Requirement already satisfied: spotipy<3.0.0,>=2.22.1 in c:\program files\python311\lib\site-packages (from spotdl) (2.22.1)
Requirement already satisfied: syncedlyrics<0.3.0,>=0.2.2 in c:\program files\python311\lib\site-packages (from spotdl) (0.2.2)
Requirement already satisfied: typing-extensions<5.0.0,>=4.5.0 in c:\program files\python311\lib\site-packages (from spotdl) (4.5.0)
Requirement already satisfied: uvicorn<0.21.0,>=0.20.0 in c:\program files\python311\lib\site-packages (from spotdl) (0.20.0)
Requirement already satisfied: yt-dlp<2024.0.0,>=2023.3.3 in c:\program files\python311\lib\site-packages (from spotdl) (2023.3.4)
Requirement already satisfied: ytmusicapi<0.25.0,>=0.24.0 in c:\program files\python311\lib\site-packages (from spotdl) (0.24.1)
Requirement already satisfied: soupsieve>1.2 in c:\program files\python311\lib\site-packages (from beautifulsoup4<5.0.0,>=4.11.2->spotdl) (2.4)
Requirement already satisfied: starlette==0.22.0 in c:\program files\python311\lib\site-packages (from fastapi<0.90.0,>=0.89.1->spotdl) (0.22.0)
Requirement already satisfied: anyio<5,>=3.4.0 in c:\program files\python311\lib\site-packages (from starlette==0.22.0->fastapi<0.90.0,>=0.89.1->spotdl) (3.6.2)
Requirement already satisfied: jaconv in c:\program files\python311\lib\site-packages (from pykakasi<3.0.0,>=2.2.1->spotdl) (0.3.4)
Requirement already satisfied: deprecated in c:\program files\python311\lib\site-packages (from pykakasi<3.0.0,>=2.2.1->spotdl) (1.2.13)
Requirement already satisfied: text-unidecode>=1.3 in c:\program files\python311\lib\site-packages (from python-slugify[unidecode]<9.0.0,>=8.0.1->spotdl) (1.3)
Requirement already satisfied: Unidecode>=1.1.1 in c:\program files\python311\lib\site-packages (from python-slugify[unidecode]<9.0.0,>=8.0.1->spotdl) (1.3.6)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\program files\python311\lib\site-packages (from requests<3.0.0,>=2.28.2->spotdl) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in c:\program files\python311\lib\site-packages (from requests<3.0.0,>=2.28.2->spotdl) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\program files\python311\lib\site-packages (from requests<3.0.0,>=2.28.2->spotdl) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in c:\program files\python311\lib\site-packages (from requests<3.0.0,>=2.28.2->spotdl) (2022.12.7)
Requirement already satisfied: markdown-it-py<3.0.0,>=2.2.0 in c:\program files\python311\lib\site-packages (from rich<14.0.0,>=13.3.1->spotdl) (2.2.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in c:\program files\python311\lib\site-packages (from rich<14.0.0,>=13.3.1->spotdl) (2.14.0)
Requirement already satisfied: redis>=3.5.3 in c:\program files\python311\lib\site-packages (from spotipy<3.0.0,>=2.22.1->spotdl) (4.5.3)
Requirement already satisfied: six>=1.15.0 in c:\program files\python311\lib\site-packages (from spotipy<3.0.0,>=2.22.1->spotdl) (1.16.0)
Requirement already satisfied: click>=7.0 in c:\program files\python311\lib\site-packages (from uvicorn<0.21.0,>=0.20.0->spotdl) (8.1.3)
Requirement already satisfied: h11>=0.8 in c:\program files\python311\lib\site-packages (from uvicorn<0.21.0,>=0.20.0->spotdl) (0.14.0)
Requirement already satisfied: pycryptodomex in c:\program files\python311\lib\site-packages (from yt-dlp<2024.0.0,>=2023.3.3->spotdl) (3.17)
Requirement already satisfied: websockets in c:\program files\python311\lib\site-packages (from yt-dlp<2024.0.0,>=2023.3.3->spotdl) (10.4)
Requirement already satisfied: brotli in c:\program files\python311\lib\site-packages (from yt-dlp<2024.0.0,>=2023.3.3->spotdl) (1.0.9)
Requirement already satisfied: colorama in c:\program files\python311\lib\site-packages (from click>=7.0->uvicorn<0.21.0,>=0.20.0->spotdl) (0.4.6)
Requirement already satisfied: mdurl~=0.1 in c:\program files\python311\lib\site-packages (from markdown-it-py<3.0.0,>=2.2.0->rich<14.0.0,>=13.3.1->spotdl) (0.1.2)
Requirement already satisfied: wrapt<2,>=1.10 in c:\program files\python311\lib\site-packages (from deprecated->pykakasi<3.0.0,>=2.2.1->spotdl) (1.15.0)
Requirement already satisfied: sniffio>=1.1 in c:\program files\python311\lib\site-packages (from anyio<5,>=3.4.0->starlette==0.22.0->fastapi<0.90.0,>=0.89.1->spotdl) (1.3.0)
Installing collected packages: spotdl
Successfully installed spotdl-4.1.3
PS C:\Windows\system32> spotdl --download-ffmpeg
FFmpeg is already installed. Do you want to overwrite it? (y/N): y
FFmpeg successfully downloaded to C:\Users\jnxr\.spotdl\ffmpeg.exe

PS C:\Windows\system32> cd C:\a\
PS C:\a> spotdl --bitrate 0 https://music.youtube.com/playlist?list=PLgeWE9wvSRs7QkgMxXMEMKENilgNzQrRl
Processing query: https://music.youtube.com/playlist?list=PLgeWE9wvSRs7QkgMxXMEMKENilgNzQrRl
Found 4548 songs in DrDisrespect Playlist 2019 (Playlist)
Downloaded "seze - Dr.Disrespect - Gillette (The Best A Man Can Get) By 199X [LINK IN DESC]":
https://music.youtube.com/watch?v=9fWxCIi5PIw
Downloaded "Carpenter Brut - Turbo Killer": https://music.youtube.com/watch?v=wy9r2qeouiQ
Downloaded "James - VHS Glitch - Doctor D": https://music.youtube.com/watch?v=rzCzRo4C8IY
Downloaded "Carpenter Brut - Invasion A.D": https://music.youtube.com/watch?v=ebJxb_ftj3g
Downloaded "Perturbator - Humans Are Such Easy Prey": https://music.youtube.com/watch?v=Y8DekFFCE5c
Downloaded "Red88Rex - Protector 101 - GUNS [SYNTHWAVE/RETROWAVE]": https://music.youtube.com/watch?v=1huI6Yrnz9Y

.
.
.
.
.
.
.
.

Downloaded "Freakyspace - Waveshaper ft. Blooded The Brave - Our Time": https://music.youtube.com/watch?v=onpIgub-ot8
Downloaded "BEST SOUNDTRACKS - Blade Runner 2049 - Soundtrack - Hans Zimmer & Benjamin Wallfisch":
https://music.youtube.com/watch?v=XYdc9butRXI
Downloaded "80s Ladies - Phaserland • Magenta Eyes (Official Video)": https://music.youtube.com/watch?v=LDD0nOCzlyE
Downloaded "Uppermost - Thousand Colors": https://music.youtube.com/watch?v=xrOQz5oJfgI
Downloaded "Android Automatic - Searching for You": https://music.youtube.com/watch?v=UnqTw8fIEnY
Downloaded "NewRetroWave - Waveshaper - Asteroid Field/ Midnight Stroll": https://music.youtube.com/watch?v=8uT7DzEnkpA
Downloaded "Phaserland - Night Rain": https://music.youtube.com/watch?v=MbEsY_5uaHg
Downloaded "NewRetroWave - Arcade High - Cool Inc. (Official Video)": https://music.youtube.com/watch?v=XvCwLCF2LcM
Downloaded "KFDDA - Amongst the Animals": https://music.youtube.com/watch?v=GFOQTmZsYO0
Downloaded "The Psychedelic Furs - The Ghost in You (Official Video)": https://music.youtube.com/watch?v=T87u5yuUVi8
Downloaded "NewRetroWave - Jordan F - Mesmerised (feat. Dana Jean Phoenix )":
https://music.youtube.com/watch?v=fvevYJbYzxM
Total                                   1708/4548 complete ----------------- -----------------------------  38% 2:58:28
Skipping NewRetroWave - Waveshaper - Hardware Passion (file already exists)
Skipping NewRetroWave - Waveshaper - Asteroid Field/ Midnight Stroll (file already exists)
Downloaded "NewRetroWave - Daniel Deluxe - Purification": https://music.youtube.com/watch?v=8QNb108WZt8
Downloaded "NewRetroWave - XYLE - Stargazer/ Escape Pod": https://music.youtube.com/watch?v=mSUAzR31Q_Y
Downloaded "NewRetroWave - Waveshaper - The Engineer Part II": https://music.youtube.com/watch?v=cncJFGH43mI
Downloaded "NewRetroWave - Waveshaper - The Space Hero": https://music.youtube.com/watch?v=AEW7Rg6UEFM
Downloaded "E-MusicAroundTheWorld - FM-84 & Ollie Wride - Running In The Night (Josep & Kane Remix)":
https://music.youtube.com/watch?v=G_lO3epdOLo
Skipping missxcessive - mind.in.a.box - Lightforce (file already exists)
An error occurred
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ C:\Program Files\Python311\Lib\site-packages\spotdl\download\downloader.py:383 in search_and_download               │
│                                                                                                                     │
│   380 │   │   reinitialized = False                                                                                 │
│   381 │   │   try:                                                                                                  │
│   382 │   │   │   # Create the output file path                                                                     │
│ > 383 │   │   │   output_file = create_file_name(                                                                   │
│   384 │   │   │   │   song,                                                                                         │
│   385 │   │   │   │   self.settings["output"],                                                                      │
│   386 │   │   │   │   self.settings["format"],                                                                      │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\formatter.py:318 in create_file_name                      │
│                                                                                                                     │
│   315 │   if not template.endswith(".{output-ext}"):                                                                │
│   316 │   │   template += ".{output-ext}"                                                                           │
│   317 │                                                                                                             │
│ > 318 │   formatted_string = format_query(                                                                          │
│   319 │   │   song=song,                                                                                            │
│   320 │   │   template=template,                                                                                    │
│   321 │   │   santitize=True,                                                                                       │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\formatter.py:222 in format_query                          │
│                                                                                                                     │
│   219 │   │   "{artist}": song.artists[0],                                                                          │
│   220 │   │   "{album}": song.album_name,                                                                           │
│   221 │   │   "{album-artist}": song.album_artist,                                                                  │
│ > 222 │   │   "{genre}": song.genres[0] if len(song.genres) > 0 else "",                                            │
│   223 │   │   "{disc-number}": song.disc_number,                                                                    │
│   224 │   │   "{disc-count}": song.disc_count,                                                                      │
│   225 │   │   "{duration}": song.duration,                                                                          │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
TypeError: object of type 'NoneType' has no len()

During handling of the above exception, another exception occurred:

┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ C:\Program Files\Python311\Lib\site-packages\spotdl\console\entry_point.py:120 in console_entry_point               │
│                                                                                                                     │
│   117 │   try:                                                                                                      │
│   118 │   │   # Pick the operation to perform                                                                       │
│   119 │   │   # based on the name and run it!                                                                       │
│ > 120 │   │   OPERATIONS[arguments.operation](                                                                      │
│   121 │   │   │   query=arguments.query,                                                                            │
│   122 │   │   │   downloader=downloader,                                                                            │
│   123 │   │   )                                                                                                     │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\console\download.py:28 in download                              │
│                                                                                                                     │
│   25 │   songs = get_simple_songs(query, use_ytm_data=downloader.settings["ytm_data"])                              │
│   26 │                                                                                                              │
│   27 │   # Download the songs                                                                                       │
│ > 28 │   downloader.download_multiple_songs(songs)                                                                  │
│   29                                                                                                                │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\download\downloader.py:253 in download_multiple_songs           │
│                                                                                                                     │
│   250 │   │   tasks = [self.pool_download(song) for song in songs]                                                  │
│   251 │   │                                                                                                         │
│   252 │   │   # Call all task asynchronously, and wait until all are finished                                       │
│ > 253 │   │   results = list(self.loop.run_until_complete(asyncio.gather(*tasks)))                                  │
│   254 │   │                                                                                                         │
│   255 │   │   # Print errors                                                                                        │
│   256 │   │   if self.settings["print_errors"]:                                                                     │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\asyncio\base_events.py:653 in run_until_complete                                     │
│                                                                                                                     │
│    650 │   │   if not future.done():                                                                                │
│    651 │   │   │   raise RuntimeError('Event loop stopped before Future completed.')                                │
│    652 │   │                                                                                                        │
│ >  653 │   │   return future.result()                                                                               │
│    654 │                                                                                                            │
│    655 │   def stop(self):                                                                                          │
│    656 │   │   """Stop running the event loop.                                                                      │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\download\downloader.py:316 in pool_download                     │
│                                                                                                                     │
│   313 │   │   # tasks that cannot acquire semaphore will wait here until it's free                                  │
│   314 │   │   # only certain amount of tasks can acquire the semaphore at the same time                             │
│   315 │   │   async with self.semaphore:                                                                            │
│ > 316 │   │   │   return await self.loop.run_in_executor(None, self.search_and_download, song)                      │
│   317 │                                                                                                             │
│   318 │   def search(self, song: Song) -> str:                                                                      │
│   319 │   │   """                                                                                                   │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\concurrent\futures\thread.py:58 in run                                               │
│                                                                                                                     │
│    55 │   │   │   return                                                                                            │
│    56 │   │                                                                                                         │
│    57 │   │   try:                                                                                                  │
│ >  58 │   │   │   result = self.fn(*self.args, **self.kwargs)                                                       │
│    59 │   │   except BaseException as exc:                                                                          │
│    60 │   │   │   self.future.set_exception(exc)                                                                    │
│    61 │   │   │   # Break a reference cycle with the exception 'exc'                                                │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\download\downloader.py:390 in search_and_download               │
│                                                                                                                     │
│   387 │   │   │   │   self.settings["restrict"],                                                                    │
│   388 │   │   │   )                                                                                                 │
│   389 │   │   except Exception:                                                                                     │
│ > 390 │   │   │   song = reinit_song(song)                                                                          │
│   391 │   │   │   output_file = create_file_name(                                                                   │
│   392 │   │   │   │   song,                                                                                         │
│   393 │   │   │   │   self.settings["output"],                                                                      │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\search.py:271 in reinit_song                              │
│                                                                                                                     │
│   268 │   if data.get("url"):                                                                                       │
│   269 │   │   new_data = Song.from_url(data["url"]).json                                                            │
│   270 │   elif data.get("name") and data.get("artist"):                                                             │
│ > 271 │   │   new_data = Song.from_search_term(data["name"]).json                                                   │
│   272 │   else:                                                                                                     │
│   273 │   │   raise QueryError("Song object is missing required data to be reinitialized")                          │
│   274                                                                                                               │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\types\song.py:162 in from_search_term                           │
│                                                                                                                     │
│   159 │   │   raw_search_results = Song.search(search_term)                                                         │
│   160 │   │                                                                                                         │
│   161 │   │   if len(raw_search_results["tracks"]["items"]) == 0:                                                   │
│ > 162 │   │   │   raise SongError(f"No results found for: {search_term}")                                           │
│   163 │   │                                                                                                         │
│   164 │   │   return Song.from_url(                                                                                 │
│   165 │   │   │   "http://open.spotify.com/track/"                                                                  │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
SongError: No results found for: S U R V I V E - HD009 - 1 - cschz 01
Downloaded "NewRetroWave - FM-84 - Tears": https://music.youtube.com/watch?v=WN7nfsK7cW8
Downloaded "Bag Raiders - Shooting Stars (Siriusmo remix)": https://music.youtube.com/watch?v=EZJ9KHXC7Mw
Downloaded "LisandorMusic - Beroshima - Polyphonication [Mueller Record]":
https://music.youtube.com/watch?v=WpJvav0OAQQ
PS C:\a>

Other details

Could not copy full output due to gihub issue outage? I keep getting the error: “body is too long (maximum is 65536 characters).” Therefore have attached it in a separate text file.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

but it’s ideal if it continues with the rest of the playlist regardless.

already done

Here’s the error I just got with my latest attempt:

PS C:\a> spotdl --bitrate 0 https:/music.youtube.com/watch?v=yn3EyK3QVgw
Processing query: https:/music.youtube.com/watch?v=yn3EyK3QVgw

An error occurred
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ C:\Program Files\Python311\Lib\site-packages\spotdl\console\entry_point.py:120 in console_entry_point               │
│                                                                                                                     │
│   117 │   try:                                                                                                      │
│   118 │   │   # Pick the operation to perform                                                                       │
│   119 │   │   # based on the name and run it!                                                                       │
│ > 120 │   │   OPERATIONS[arguments.operation](                                                                      │
│   121 │   │   │   query=arguments.query,                                                                            │
│   122 │   │   │   downloader=downloader,                                                                            │
│   123 │   │   )                                                                                                     │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\console\download.py:25 in download                              │
│                                                                                                                     │
│   22 │   """                                                                                                        │
│   23 │                                                                                                              │
│   24 │   # Parse the query                                                                                          │
│ > 25 │   songs = get_simple_songs(query, use_ytm_data=downloader.settings["ytm_data"])                              │
│   26 │                                                                                                              │
│   27 │   # Download the songs                                                                                       │
│   28 │   downloader.download_multiple_songs(songs)                                                                  │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\search.py:220 in get_simple_songs                         │
│                                                                                                                     │
│   217 │   │   │   │   │   # Append to songs                                                                         │
│   218 │   │   │   │   │   songs.append(Song.from_dict(track))                                                       │
│   219 │   │   else:                                                                                                 │
│ > 220 │   │   │   songs.append(Song.from_search_term(request))                                                      │
│   221 │                                                                                                             │
│   222 │   for song_list in lists:                                                                                   │
│   223 │   │   logger.info(                                                                                          │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\types\song.py:162 in from_search_term                           │
│                                                                                                                     │
│   159 │   │   raw_search_results = Song.search(search_term)                                                         │
│   160 │   │                                                                                                         │
│   161 │   │   if len(raw_search_results["tracks"]["items"]) == 0:                                                   │
│ > 162 │   │   │   raise SongError(f"No results found for: {search_term}")                                           │
│   163 │   │                                                                                                         │
│   164 │   │   return Song.from_url(                                                                                 │
│   165 │   │   │   "http://open.spotify.com/track/"                                                                  │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
SongError: No results found for: https:/music.youtube.com/watch?v=yn3EyK3QVgw
PS C:\a>

This song has wrong title/artist on youtube music, song title is “artist name + album name + song title” and artist name is “label name”. Really weird, that’s why spotDL can’t find the correct song on spotify.

Should be fixed

I totally thought that I’ve fixed this…

ee319ccef843f78d41f22f03d431765a47899db1 this should resolve your issue

for now install dev version, and let me know if it works, if it’s still isn’t working send me link to the song that keeps breaking the download

Oh I’ve just noticed that you are trying to download an youtube music playlist. This is very experimental, but either way I will try to fix your issue.