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.48k stars 1.6k forks source link

ValueError: invalid literal for int() with base 10: 'al' with some tracks when synced is enabled as a lyrics provider #1816

Closed azumukupoe closed 1 year ago

azumukupoe commented 1 year ago

System OS

Windows

Python Version

3.11 (CPython)

Install Source

pip / PyPi

Install version / commit hash

v4.1.7

Expected Behavior vs Actual Behavior

No response

Steps to reproduce - Ensure to include actual links!

spotdl download https://open.spotify.com/track/6OKUhXuJMvoVPde9fMJJzy

Traceback

[09:57:25] DEBUG    MainThread - Downloader settings: {'audio_providers': ['youtube-music'],           downloader.py:115
                    'lyrics_providers': ['synced', 'genius', 'azlyrics', 'musixmatch'],
                    'playlist_numbering': False, 'scan_for_songs': True, 'm3u': None, 'output':
                    'D:\\Music\\{album-artist}\\{album} ({year})\\{disc-number} - {track-number} -
                    {title}.{output-ext}', 'overwrite': 'metadata', 'search_query': None, 'ffmpeg':
                    'ffmpeg', 'bitrate': None, 'ffmpeg_args': None, 'format': 'mp3', 'save_file':
                    None, 'filter_results': True, 'threads': 4, 'cookie_file': None, 'restrict':
                    False, 'print_errors': True, 'sponsor_block': False, 'preload': True, 'archive':
                    None, 'load_config': True, 'log_level': 'DEBUG', 'simple_tui': False,
                    'fetch_albums': True, 'id3_separator': '/', 'ytm_data': False, 'add_unavailable':
                    False, 'generate_lrc': True, 'force_update_metadata': True,
                    'only_verified_results': True, 'sync_without_deleting': True,
                    'max_filename_length': 100}
[09:57:25] DEBUG    MainThread - FFmpeg path: ffmpeg                                                   downloader.py:133
[09:57:25] INFO     MainThread - Scanning for known songs, this might take a while...                  downloader.py:152
[09:57:35] DEBUG    MainThread - Found 2032 known songs                                                downloader.py:158
[09:57:38] DEBUG    MainThread - Archive: 0 urls                                                       downloader.py:192
[09:57:38] DEBUG    MainThread - Downloader initialized                                                downloader.py:194
[09:57:38] INFO     MainThread - Processing query: https://open.spotify.com/track/6OKUhXuJMvoVPde9fMJJzy   search.py:123
[09:57:38] DEBUG    MainThread - Found 1 songs in 0 lists                                                  search.py:249
[09:57:38] INFO     MainThread - Fetching 1 album                                                      downloader.py:228
[09:57:38] DEBUG    MainThread - Downloading 11 songs                                                  downloader.py:241
[09:57:39] DEBUG    asyncio_2 - Found lyrics for Suzanne Vega - Ironbound / Fancy Poultry on Synced    downloader.py:352
[09:57:39] DEBUG    asyncio_2 - [1nGsMPHgXDaYbe5XLI4juT] Searching for suzanne vega - ironbound / fancy      base.py:157
                    poultry
[09:57:39] DEBUG    asyncio_1 - Found lyrics for Suzanne Vega - Luka on Synced                         downloader.py:352
[09:57:39] DEBUG    asyncio_1 - [5yMXAaSvxo12QkYU75Ixv0] Searching for suzanne vega - luka                   base.py:157
[09:57:39] DEBUG    asyncio_2 - [1nGsMPHgXDaYbe5XLI4juT] Found 1 results for ISRC USAM18790003               base.py:172
[09:57:39] DEBUG    asyncio_2 - [1nGsMPHgXDaYbe5XLI4juT] Filtered to 1 ISRC results                          base.py:184
[09:57:39] DEBUG    asyncio_2 - [1nGsMPHgXDaYbe5XLI4juT] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=wnV-DPmrkLk with score 100.0
[09:57:39] DEBUG    asyncio_2 - Downloading Suzanne Vega - Ironbound / Fancy Poultry using             downloader.py:566
                    https://music.youtube.com/watch?v=wnV-DPmrkLk
[09:57:39] DEBUG    asyncio_1 - [5yMXAaSvxo12QkYU75Ixv0] Found 1 results for ISRC USAM18704255               base.py:172
[09:57:39] DEBUG    asyncio_1 - [5yMXAaSvxo12QkYU75Ixv0] Filtered to 1 ISRC results                          base.py:184
[09:57:39] DEBUG    asyncio_1 - [5yMXAaSvxo12QkYU75Ixv0] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=SiTPX2ks-jU with score 100.0
[09:57:40] DEBUG    asyncio_1 - Downloading Suzanne Vega - Luka using                                  downloader.py:566
                    https://music.youtube.com/watch?v=SiTPX2ks-jU
[09:57:41] DEBUG    asyncio_0 - Found lyrics for Suzanne Vega - Tom's Diner on Synced                  downloader.py:352
[09:57:41] DEBUG    asyncio_0 - [6OKUhXuJMvoVPde9fMJJzy] Searching for suzanne vega - tom's diner            base.py:157
[09:57:41] DEBUG    asyncio_0 - [6OKUhXuJMvoVPde9fMJJzy] Found 1 results for ISRC USAM18790001               base.py:172
[09:57:41] DEBUG    asyncio_0 - [6OKUhXuJMvoVPde9fMJJzy] Filtered to 1 ISRC results                          base.py:184
[09:57:41] DEBUG    asyncio_0 - [6OKUhXuJMvoVPde9fMJJzy] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=L9x-DENKIts with score 100.0
[09:57:41] DEBUG    asyncio_0 - Downloading Suzanne Vega - Tom's Diner using                           downloader.py:566
                    https://music.youtube.com/watch?v=L9x-DENKIts
None
[09:57:47] ERROR    asyncio_0 - Traceback (most recent call last):                               progress_handler.py:358
                      File "C:\spotDL\venv\Lib\site-packages\spotdl\download\downloader.py",
                    line 711, in search_and_download
                        embed_metadata(output_file, song, self.settings["id3_separator"])
                      File "C:\spotDL\venv\Lib\site-packages\spotdl\utils\metadata.py", line
                    219, in embed_metadata
                        audio_file = embed_lyrics(audio_file, song, encoding)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      File "C:\spotDL\venv\Lib\site-packages\spotdl\utils\metadata.py", line
                    325, in embed_lyrics
                        time = to_ms(min=minute, sec=sec, ms=millisecond)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      File "C:\spotDL\venv\Lib\site-packages\spotdl\utils\formatter.py", line
                    468, in to_ms
                        minute = int(kwargs.get("min", 0))
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
                    ValueError: invalid literal for int() with base 10: 'al'

                    The above exception was the direct cause of the following exception:

                    Traceback (most recent call last):
                      File "C:\spotDL\venv\Lib\site-packages\spotdl\download\downloader.py",
                    line 713, in search_and_download
                        raise MetadataError(
                    spotdl.utils.metadata.MetadataError: Failed to embed metadata to the song

                    ╭─────────────────── Traceback (most recent call last) ────────────────────╮
                    │ C:\spotDL\venv\Lib\site-packages\spotdl\download\downloader.py:711 in    │
                    │ search_and_download                                                      │
                    │                                                                          │
                    │   708 │   │   │   │   │   │   Path(file_to_delete).unlink()              │
                    │   709 │   │   │                                                          │
                    │   710 │   │   │   try:                                                   │
                    │ ❱ 711 │   │   │   │   embed_metadata(output_file, song, self.settings["i │
                    │   712 │   │   │   except Exception as exception:                         │
                    │   713 │   │   │   │   raise MetadataError(                               │
                    │   714 │   │   │   │   │   "Failed to embed metadata to the song"         │
                    │                                                                          │
                    │ C:\spotDL\venv\Lib\site-packages\spotdl\utils\metadata.py:219 in         │
                    │ embed_metadata                                                           │
                    │                                                                          │
                    │   216 │   audio_file = embed_cover(audio_file, song, encoding)           │
                    │   217 │                                                                  │
                    │   218 │   # Embed lyrics                                                 │
                    │ ❱ 219 │   audio_file = embed_lyrics(audio_file, song, encoding)          │
                    │   220 │                                                                  │
                    │   221 │   # Mp3 specific encoding                                        │
                    │   222 │   if encoding == "mp3":                                          │
                    │                                                                          │
                    │ C:\spotDL\venv\Lib\site-packages\spotdl\utils\metadata.py:325 in         │
                    │ embed_lyrics                                                             │
                    │                                                                          │
                    │   322 │   │   │   │   │   continue                                       │
                    │   323 │   │   │   │                                                      │
                    │   324 │   │   │   │   minute, sec, millisecond = time_tag_vals           │
                    │ ❱ 325 │   │   │   │   time = to_ms(min=minute, sec=sec, ms=millisecond)  │
                    │   326 │   │   │   │   lrc_data.append((text, time))                      │
                    │   327 │   │   │                                                          │
                    │   328 │   │   │   audio_file.add(USLT(encoding=3, text=song.lyrics))     │
                    │                                                                          │
                    │ C:\spotDL\venv\Lib\site-packages\spotdl\utils\formatter.py:468 in to_ms  │
                    │                                                                          │
                    │   465 │   │   milliseconds = int(string[10:11])                          │
                    │   466 │   else:                                                          │
                    │   467 │   │   hour = int(kwargs.get("hour", 0))                          │
                    │ ❱ 468 │   │   minute = int(kwargs.get("min", 0))                         │
                    │   469 │   │   sec = int(kwargs.get("sec", 0))                            │
                    │   470 │   │   milliseconds = int(kwargs.get("ms", 0))                    │
                    │   471                                                                    │
                    ╰──────────────────────────────────────────────────────────────────────────╯
                    ValueError: invalid literal for int() with base 10: 'al'

                    The above exception was the direct cause of the following exception:

                    ╭─────────────────── Traceback (most recent call last) ────────────────────╮
                    │ C:\spotDL\venv\Lib\site-packages\spotdl\download\downloader.py:713 in    │
                    │ search_and_download                                                      │
                    │                                                                          │
                    │   710 │   │   │   try:                                                   │
                    │   711 │   │   │   │   embed_metadata(output_file, song, self.settings["i │
                    │   712 │   │   │   except Exception as exception:                         │
                    │ ❱ 713 │   │   │   │   raise MetadataError(                               │
                    │   714 │   │   │   │   │   "Failed to embed metadata to the song"         │
                    │   715 │   │   │   │   ) from exception                                   │
                    │   716                                                                    │
                    ╰──────────────────────────────────────────────────────────────────────────╯
                    MetadataError: Failed to embed metadata to the song
[09:57:47] DEBUG    asyncio_3 - Found lyrics for Suzanne Vega - In The Eye on Genius                   downloader.py:352
[09:57:47] DEBUG    asyncio_3 - [0yvvH8H2URqofMpFs6N5W9] Searching for suzanne vega - in the eye             base.py:157
[09:57:48] DEBUG    asyncio_3 - [0yvvH8H2URqofMpFs6N5W9] Found 1 results for ISRC USAM18790004               base.py:172
[09:57:48] DEBUG    asyncio_3 - [0yvvH8H2URqofMpFs6N5W9] Filtered to 1 ISRC results                          base.py:184
[09:57:48] DEBUG    asyncio_3 - [0yvvH8H2URqofMpFs6N5W9] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=tXwmeEZPl0Y with score 100.0
[09:57:48] DEBUG    asyncio_3 - Downloading Suzanne Vega - In The Eye using                            downloader.py:566
                    https://music.youtube.com/watch?v=tXwmeEZPl0Y
[09:57:48] DEBUG    asyncio_1 - Saved lrc file for Suzanne Vega - Luka                                         lrc.py:37
[09:57:48] INFO     asyncio_1 - Downloaded "Suzanne Vega - Luka":                                      downloader.py:725
                    https://music.youtube.com/watch?v=SiTPX2ks-jU
[09:57:52] DEBUG    asyncio_2 - Saved lrc file for Suzanne Vega - Ironbound / Fancy Poultry                    lrc.py:37
[09:57:52] INFO     asyncio_2 - Downloaded "Suzanne Vega - Ironbound / Fancy Poultry":                 downloader.py:725
                    https://music.youtube.com/watch?v=wnV-DPmrkLk
[09:57:53] DEBUG    asyncio_2 - Found lyrics for Suzanne Vega - Calypso on Synced                      downloader.py:352
[09:57:53] DEBUG    asyncio_2 - [5AflA0BW53NMe3z5qLFidF] Searching for suzanne vega - calypso                base.py:157
[09:57:53] DEBUG    asyncio_2 - [5AflA0BW53NMe3z5qLFidF] Found 1 results for ISRC USAM18790007               base.py:172
[09:57:53] DEBUG    asyncio_2 - [5AflA0BW53NMe3z5qLFidF] Filtered to 1 ISRC results                          base.py:184
[09:57:53] DEBUG    asyncio_2 - [5AflA0BW53NMe3z5qLFidF] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=I8ExnrHJRUA with score 100.0
[09:57:53] DEBUG    asyncio_2 - Downloading Suzanne Vega - Calypso using                               downloader.py:566
                    https://music.youtube.com/watch?v=I8ExnrHJRUA
None
[09:57:54] DEBUG    asyncio_1 - Synced failed to find lyrics for Suzanne Vega - Solitude Standing      downloader.py:358
None
[09:57:54] DEBUG    asyncio_0 - Synced failed to find lyrics for Suzanne Vega - Night Vision           downloader.py:358
[09:57:56] DEBUG    asyncio_1 - Found lyrics for Suzanne Vega - Solitude Standing on Genius            downloader.py:352
[09:57:56] DEBUG    asyncio_1 - [3XfjgqBGTmgzl8XencUM2e] Searching for suzanne vega - solitude standing      base.py:157
[09:57:56] DEBUG    asyncio_0 - Found lyrics for Suzanne Vega - Night Vision on Genius                 downloader.py:352
[09:57:56] DEBUG    asyncio_0 - [1DZHq1mu4Q8uWT33ORE7Sf] Searching for suzanne vega - night vision           base.py:157
[09:57:56] DEBUG    asyncio_3 - Saved lrc file for Suzanne Vega - In The Eye                                   lrc.py:37
[09:57:56] INFO     asyncio_3 - Downloaded "Suzanne Vega - In The Eye":                                downloader.py:725
                    https://music.youtube.com/watch?v=tXwmeEZPl0Y
[09:57:56] DEBUG    asyncio_1 - [3XfjgqBGTmgzl8XencUM2e] Found 1 results for ISRC USAM18790006               base.py:172
[09:57:56] DEBUG    asyncio_1 - [3XfjgqBGTmgzl8XencUM2e] Filtered to 1 ISRC results                          base.py:184
[09:57:56] DEBUG    asyncio_1 - [3XfjgqBGTmgzl8XencUM2e] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=Vse7-fjlkDQ with score 100.0
[09:57:56] DEBUG    asyncio_0 - [1DZHq1mu4Q8uWT33ORE7Sf] Found 1 results for ISRC USAM18790005               base.py:172
[09:57:56] DEBUG    asyncio_0 - [1DZHq1mu4Q8uWT33ORE7Sf] Filtered to 1 ISRC results                          base.py:184
[09:57:56] DEBUG    asyncio_0 - [1DZHq1mu4Q8uWT33ORE7Sf] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=wsso9MAHYoc with score 100.0
[09:57:56] DEBUG    asyncio_1 - Downloading Suzanne Vega - Solitude Standing using                     downloader.py:566
                    https://music.youtube.com/watch?v=Vse7-fjlkDQ
[09:57:56] DEBUG    asyncio_0 - Downloading Suzanne Vega - Night Vision using                          downloader.py:566
                    https://music.youtube.com/watch?v=wsso9MAHYoc
[09:57:57] DEBUG    asyncio_3 - Found lyrics for Suzanne Vega - Language on Synced                     downloader.py:352
[09:57:57] DEBUG    asyncio_3 - [1BXuqX6Zk3fUs6JyJBvFXm] Searching for suzanne vega - language               base.py:157
[09:57:57] DEBUG    asyncio_3 - [1BXuqX6Zk3fUs6JyJBvFXm] Found 1 results for ISRC USAM18790008               base.py:172
[09:57:57] DEBUG    asyncio_3 - [1BXuqX6Zk3fUs6JyJBvFXm] Filtered to 1 ISRC results                          base.py:184
[09:57:57] DEBUG    asyncio_3 - [1BXuqX6Zk3fUs6JyJBvFXm] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=kISZKZqjUs4 with score 100.0
[09:57:57] DEBUG    asyncio_3 - Downloading Suzanne Vega - Language using                              downloader.py:566
                    https://music.youtube.com/watch?v=kISZKZqjUs4
[09:58:03] DEBUG    asyncio_2 - Saved lrc file for Suzanne Vega - Calypso                                      lrc.py:37
[09:58:03] INFO     asyncio_2 - Downloaded "Suzanne Vega - Calypso":                                   downloader.py:725
                    https://music.youtube.com/watch?v=I8ExnrHJRUA
[09:58:04] DEBUG    asyncio_0 - Saved lrc file for Suzanne Vega - Night Vision                                 lrc.py:37
[09:58:04] INFO     asyncio_0 - Downloaded "Suzanne Vega - Night Vision":                              downloader.py:725
                    https://music.youtube.com/watch?v=wsso9MAHYoc
[09:58:05] DEBUG    asyncio_4 - Found lyrics for Suzanne Vega - Gypsy on Synced                        downloader.py:352
[09:58:05] DEBUG    asyncio_4 - [4DWRhnsa7MAVr4meyed1EF] Searching for suzanne vega - gypsy                  base.py:157
[09:58:05] DEBUG    asyncio_4 - [4DWRhnsa7MAVr4meyed1EF] Found 1 results for ISRC USAM18790009               base.py:172
[09:58:05] DEBUG    asyncio_4 - [4DWRhnsa7MAVr4meyed1EF] Filtered to 1 ISRC results                          base.py:184
[09:58:05] DEBUG    asyncio_4 - [4DWRhnsa7MAVr4meyed1EF] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=1kOG4FVuqG8 with score 100.0
[09:58:05] DEBUG    asyncio_4 - Downloading Suzanne Vega - Gypsy using                                 downloader.py:566
                    https://music.youtube.com/watch?v=1kOG4FVuqG8
[09:58:06] DEBUG    asyncio_3 - Saved lrc file for Suzanne Vega - Language                                     lrc.py:37
[09:58:06] INFO     asyncio_3 - Downloaded "Suzanne Vega - Language":                                  downloader.py:725
                    https://music.youtube.com/watch?v=kISZKZqjUs4
[09:58:07] DEBUG    asyncio_1 - Saved lrc file for Suzanne Vega - Solitude Standing                            lrc.py:37
[09:58:07] INFO     asyncio_1 - Downloaded "Suzanne Vega - Solitude Standing":                         downloader.py:725
                    https://music.youtube.com/watch?v=Vse7-fjlkDQ
[09:58:07] DEBUG    asyncio_3 - Found lyrics for Suzanne Vega - Tom's Diner - Reprise on Synced        downloader.py:352
[09:58:07] DEBUG    asyncio_3 - [6n85rvW9XiJKC1aljAJErb] Searching for suzanne vega - tom's diner - reprise  base.py:157
[09:58:07] DEBUG    asyncio_3 - [6n85rvW9XiJKC1aljAJErb] Found 1 results for ISRC USWWW0129648               base.py:172
[09:58:07] DEBUG    asyncio_3 - [6n85rvW9XiJKC1aljAJErb] Filtered to 1 ISRC results                          base.py:184
[09:58:07] DEBUG    asyncio_3 - [6n85rvW9XiJKC1aljAJErb] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=bnOQIfaNQso with score 100.0
[09:58:07] DEBUG    asyncio_3 - Downloading Suzanne Vega - Tom's Diner - Reprise using                 downloader.py:566
                    https://music.youtube.com/watch?v=bnOQIfaNQso
None
[09:58:10] DEBUG    asyncio_2 - Synced failed to find lyrics for Suzanne Vega - Wooden Horse (Casper   downloader.py:358
                    Hauser's Song)
[09:58:11] DEBUG    asyncio_2 - Found lyrics for Suzanne Vega - Wooden Horse (Casper Hauser's Song) on downloader.py:352
                    Genius
[09:58:11] DEBUG    asyncio_2 - [4r9j4voYflyKBUXOSfiQCf] Searching for suzanne vega - wooden horse (casper   base.py:157
                    hauser's song)
[09:58:12] DEBUG    asyncio_2 - [4r9j4voYflyKBUXOSfiQCf] Found 1 results for ISRC USAM18790010               base.py:172
[09:58:12] DEBUG    asyncio_2 - [4r9j4voYflyKBUXOSfiQCf] Filtered to 1 ISRC results                          base.py:184
[09:58:12] DEBUG    asyncio_2 - [4r9j4voYflyKBUXOSfiQCf] Best ISRC result is                                 base.py:193
                    https://music.youtube.com/watch?v=nPBZDs5y2vg with score 100.0
[09:58:12] DEBUG    asyncio_2 - Downloading Suzanne Vega - Wooden Horse (Casper Hauser's Song) using   downloader.py:566
                    https://music.youtube.com/watch?v=nPBZDs5y2vg
[09:58:13] DEBUG    asyncio_4 - Saved lrc file for Suzanne Vega - Gypsy                                        lrc.py:37
[09:58:13] INFO     asyncio_4 - Downloaded "Suzanne Vega - Gypsy":                                     downloader.py:725
                    https://music.youtube.com/watch?v=1kOG4FVuqG8
[09:58:14] DEBUG    asyncio_3 - Saved lrc file for Suzanne Vega - Tom's Diner - Reprise                        lrc.py:37
[09:58:14] INFO     asyncio_3 - Downloaded "Suzanne Vega - Tom's Diner - Reprise":                     downloader.py:725
                    https://music.youtube.com/watch?v=bnOQIfaNQso
None
[09:58:29] DEBUG    asyncio_2 - No lrc file found for Suzanne Vega - Wooden Horse (Casper Hauser's Song)       lrc.py:39
[09:58:29] INFO     asyncio_2 - Downloaded "Suzanne Vega - Wooden Horse (Casper Hauser's Song)":       downloader.py:725
                    https://music.youtube.com/watch?v=nPBZDs5y2vg
[09:58:29] ERROR    MainThread - https://open.spotify.com/track/6OKUhXuJMvoVPde9fMJJzy -               downloader.py:258
                    MetadataError: Failed to embed metadata to the song

Other details

No response

xnetcat commented 1 year ago

damn bro you on fire with these issues. keep em coming. new version tomorrow I guess with bug fixes I gtg sleep for now.