spotDL / spotify-downloader

Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found).
https://spotdl.readthedocs.io/en/latest/
MIT License
17.81k stars 1.62k forks source link

SpotDL 4.1.4 stops abruptly with errors at the 38% mark in the middle of playlist #1780

Closed jnxr closed 1 year ago

jnxr commented 1 year ago

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.

jnxr commented 1 year ago

Just checked it by running the following command: pip install --force -U https://codeload.github.com/spotDL/spotify-downloader/zip/dev

Installed version now states 4.1.4.

But is not yet going past the same 38% point.

The first half of the error is different though:

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:321 in create_file_name                      │
│                                                                                                                     │
│   318 │   if not template.endswith(".{output-ext}"):                                                                │
│   319 │   │   template += ".{output-ext}"                                                                           │
│   320 │                                                                                                             │
│ > 321 │   formatted_string = format_query(                                                                          │
│   322 │   │   song=song,                                                                                            │
│   323 │   │   template=template,                                                                                    │
│   324 │   │   santitize=True,                                                                                       │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\formatter.py:228 in format_query                          │
│                                                                                                                     │
│   225 │   │   "{duration}": song.duration,                                                                          │
│   226 │   │   "{year}": song.year,                                                                                  │
│   227 │   │   "{original-date}": song.date,                                                                         │
│ > 228 │   │   "{track-number}": f"{song.track_number:02d}",                                                         │
│   229 │   │   "{tracks-count}": song.tracks_count,                                                                  │
│   230 │   │   "{isrc}": song.isrc,                                                                                  │
│   231 │   │   "{track-id}": song.song_id,                                                                           │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
TypeError: unsupported format string passed to NoneType.__format__

The second half is the same..

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/"                                                                  │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Hope this helps.

xnetcat commented 1 year ago

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.

jnxr commented 1 year ago

Greatly appreciated. I do heavily depend on it. So here's hoping it becomes much more than experimental, as time goes.

jnxr commented 1 year ago

Hey there. I just finished checking it and then rechecking it again, in a VM just to be extra sure. It still stops at the same 38% mark. The error I saw is as follows:

┌────────────────────────────── 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:321 in create_file_name │
│                                                                                                │
│   318 │   if not template.endswith(".{output-ext}"):                                           │
│   319 │   │   template += ".{output-ext}"                                                      │
│   320 │                                                                                        │
│ > 321 │   formatted_string = format_query(                                                     │
│   322 │   │   song=song,                                                                       │
│   323 │   │   template=template,                                                               │
│   324 │   │   santitize=True,                                                                  │
│                                                                                                │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\formatter.py:228 in format_query     │
│                                                                                                │
│   225 │   │   "{duration}": song.duration,                                                     │
│   226 │   │   "{year}": song.year,                                                             │
│   227 │   │   "{original-date}": song.date,                                                    │
│ > 228 │   │   "{track-number}": f"{song.track_number:02d}",                                    │
│   229 │   │   "{tracks-count}": song.tracks_count,                                             │
│   230 │   │   "{isrc}": song.isrc,                                                             │
│   231 │   │   "{track-id}": song.song_id,                                                      │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
TypeError: unsupported format string passed to NoneType.__format__

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:291 in reinit_song         │
│                                                                                                │
│   288 │   if data.get("url"):                                                                  │
│   289 │   │   new_data = Song.from_url(data["url"]).json                                       │
│   290 │   elif data.get("name") and data.get("artist"):                                        │
│ > 291 │   │   new_data = Song.from_search_term(data["name"]).json                              │
│   292 │   else:                                                                                │
│   293 │   │   raise QueryError("Song object is missing required data to be reinitialized")     │
│   294                                                                                          │
│                                                                                                │
│ 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/"                                             │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
jnxr commented 1 year ago

@xnetcat I changed the title, but should I make a new issue post since this one has been closed?

xnetcat commented 1 year ago

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

jnxr commented 1 year ago

I rechecked it with the dev branch. Here are the last few lines from the command prompt, when the error occurs:

Skipping missxcessive - mind.in.a.box - Lightforce (file already exists)
Skipping ANORAAK - Nightdrive With You (file already exists)
Skipping Chromatics - Tick of the Clock (file already exists)
Skipping The Prismer - Desire - Under Your Spell (file already exists)
Skipping burial80 - Glass Candy - Digital Versicolor (file already exists)
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: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:455 in search_and_download               │
│                                                                                                                     │
│   452 │   │   │   │   song.album_artist,                                                                            │
│   453 │   │   │   ]                                                                                                 │
│   454 │   │   ):                                                                                                    │
│ > 455 │   │   │   song = reinit_song(song)                                                                          │
│   456 │   │   │   reinitialized = True                                                                              │
│   457 │   │                                                                                                         │
│   458 │   │   # Don't skip if the file exists and overwrite is set to force                                         │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\search.py:291 in reinit_song                              │
│                                                                                                                     │
│   288 │   if data.get("url"):                                                                                       │
│   289 │   │   new_data = Song.from_url(data["url"]).json                                                            │
│   290 │   elif data.get("name") and data.get("artist"):                                                             │
│ > 291 │   │   new_data = Song.from_search_term(data["name"]).json                                                   │
│   292 │   else:                                                                                                     │
│   293 │   │   raise QueryError("Song object is missing required data to be reinitialized")                          │
│   294                                                                                                               │
│                                                                                                                     │
│ 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 "Cinnamon Chasers - Cinnamon Chasers - Speeder": https://music.youtube.com/watch?v=j8ApUrafImQ
Downloaded "TheToxicAvengerBand - The Toxic Avenger - Spaced": https://music.youtube.com/watch?v=vSoZqSCStfA
Downloaded "Medulla Mactabile Maculae - M/M/M - DISTANT PROJECTIONS": https://music.youtube.com/watch?v=YzTGJvhpyVE
PS C:\a>
jnxr commented 1 year ago

This is what I got when I double checking it:

Total                                   1721/4548 complete ----------------- -----------------------------  38% 0:02:00
Holodeck Records - S U R V I V E - HD0… Download Started   -----------------------------------------------   0% -:--:--
Chromatics - Tick of the Clock          Download Started   -----------------------------------------------   0% -:--:--
The Prismer - Desire - Under Your Spell Download Started   -----------------------------------------------   0% -:--:--
burial80 - Glass Candy - Digital Versi… Download Started   -----------------------------------------------   0% -:--:--Skipping The Prismer - Desire - Under Your Spell (file already exists)
Skipping burial80 - Glass Candy - Digital Versicolor (file already exists)
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: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:455 in search_and_download               │
│                                                                                                                     │
│   452 │   │   │   │   song.album_artist,                                                                            │
│   453 │   │   │   ]                                                                                                 │
│   454 │   │   ):                                                                                                    │
│ > 455 │   │   │   song = reinit_song(song)                                                                          │
│   456 │   │   │   reinitialized = True                                                                              │
│   457 │   │                                                                                                         │
│   458 │   │   # Don't skip if the file exists and overwrite is set to force                                         │
│                                                                                                                     │
│ C:\Program Files\Python311\Lib\site-packages\spotdl\utils\search.py:291 in reinit_song                              │
│                                                                                                                     │
│   288 │   if data.get("url"):                                                                                       │
│   289 │   │   new_data = Song.from_url(data["url"]).json                                                            │
│   290 │   elif data.get("name") and data.get("artist"):                                                             │
│ > 291 │   │   new_data = Song.from_search_term(data["name"]).json                                                   │
│   292 │   else:                                                                                                     │
│   293 │   │   raise QueryError("Song object is missing required data to be reinitialized")                          │
│   294                                                                                                               │
│                                                                                                                     │
│ 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
jnxr commented 1 year ago

I think its getting stuck at this song: https://music.youtube.com/watch?v=yn3EyK3QVgw

The issue is that it exits the entire playlist whenever such an error occurs instead of going ahead with the next item in the playlist because of which playlists end up unfinished. I have seen this occur in other playlists before, but never did make a post here until now.

xnetcat commented 1 year ago

Should be fixed

jnxr commented 1 year ago

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>
xnetcat commented 1 year ago

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.

jnxr commented 1 year ago

spotDL can't find the correct song on spotify.

I see, indeed it is unusual. Not sure how you're gonna correct for such an edge case, but it's ideal if it continues with the rest of the playlist regardless.

xnetcat commented 1 year ago

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

already done

jnxr commented 1 year ago

already done

Awesome!

Downloading the song is still giving the following error:

C:\a>spotdl 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

C:\a>

But with the playlist, it skipped the error causing track successfully, very nice!


PS: @xnetcat If the data can't be found in Spotify, for cases like this where we download from YouTube Music/YouTube playlists, I propose that the song/audio be converted as is without Metadata from Spotify. Perhaps, lookingup an alternative source/database, can be incorporated as a future solution/feature. But right now, just making it possible to convert without Metadata when it can't be found in Spotify would mean that it would work with all YouTube playlists, not just Music ones. That would make it a lot more versatile, since we could simply make audio mp3 playlists of everything from YouTube!

jnxr commented 1 year ago

@xnetcat should I make the above post into a separate feature request? It would help a ton, if it worked across all youtube playlists.