mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Outputs error details when track download fails from list file (#406)
This commit is contained in:
committed by
Ritiek Malhotra
parent
94f0b3e95d
commit
680525ea3d
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user