From 680525ea3d9f7714bd702ad055527a8c85cab771 Mon Sep 17 00:00:00 2001 From: Manveer Basra Date: Wed, 24 Oct 2018 12:36:39 -0400 Subject: [PATCH] Outputs error details when track download fails from list file (#406) --- spotdl/spotdl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spotdl/spotdl.py b/spotdl/spotdl.py index c3fcc6e..2e41a46 100755 --- a/spotdl/spotdl.py +++ b/spotdl/spotdl.py @@ -101,13 +101,14 @@ def download_list(tracks_file, skip_file=None, write_successful_file=None): spotify_tools.spotify = spotipy.Spotify(auth=new_token) download_single(raw_song, number=number) # detect network problems - except (urllib.request.URLError, TypeError, IOError): + except (urllib.request.URLError, TypeError, IOError) as e: tracks.append(raw_song) # remove the downloaded song from file internals.trim_song(tracks_file) # and append it at the end of file with open(tracks_file, "a") as f: f.write("\n" + raw_song) + log.exception(e) log.warning("Failed to download song. Will retry after other songs\n") # wait 0.5 sec to avoid infinite looping time.sleep(0.5)