glomatico / spotify-web-downloader

A Python CLI app for downloading songs/music videos/albums/playlists directly from Spotify.
378 stars 43 forks source link

error #48

Closed danielbanar closed 1 month ago

danielbanar commented 1 month ago

[WARNING 20:22:59] (Track 250/294 from URL 1/1) Track already exists at "Spotify\Darude - Sandstorm.m4a", skipping Traceback (most recent call last): File "d:\venv\venv\lib\site-packages\spotify_web_downloader\cli.py", line 405, in main logger.info(f'({queue_progress}) Downloading "{track["name"]}"') TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): ...... File "d:\venv\venv\lib\site-packages\spotify_web_downloader\cli.py", line 610, in main f'({queue_progress}) Failed to download "{track["name"]}"', TypeError: 'NoneType' object is not subscriptable

ChatGPT cooked and fixed it: end of cli.py


                error_count += 1
                if track and "name" in track and track["name"] is not None:
                    track_name = track["name"]
                else:
                    track_name = "Unknown track"
                logger.error(
                    f'({queue_progress}) Failed to download "{track_name}"',
                    exc_info=print_exceptions,
                )