From c5886e340114a09c181ca6b1052885176d312be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 22 Nov 2021 14:45:20 +0100 Subject: [PATCH] Exception traceback in GENERAL DOWNLOAD ERROR --- zspotify/track.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zspotify/track.py b/zspotify/track.py index 8f4ef9d..73197ae 100644 --- a/zspotify/track.py +++ b/zspotify/track.py @@ -14,7 +14,7 @@ from termoutput import Printer, PrintChannel from utils import fix_filename, set_audio_tags, set_music_thumbnail, create_download_directory, \ get_directory_song_ids, add_to_directory_song_ids, get_previously_downloaded, add_to_archive from zspotify import ZSpotify - +import traceback def get_saved_tracks() -> list: """ Returns user's saved tracks """ @@ -131,7 +131,7 @@ def download_track(mode: str, track_id: str, extra_keys={}, disable_progressbar= stream = ZSpotify.get_content_stream( track_id, ZSpotify.DOWNLOAD_QUALITY) create_download_directory(filedir) - total_size = stream.input_stream.size + total_size = stream.input_stream.size / "" with open(filename, 'wb') as file, Printer.progress( desc=song_name, @@ -166,6 +166,7 @@ def download_track(mode: str, track_id: str, extra_keys={}, disable_progressbar= except Exception as e: Printer.print(PrintChannel.ERRORS, '### SKIPPING: ' + song_name + ' (GENERAL DOWNLOAD ERROR) ###') Printer.print(PrintChannel.ERRORS, str(e) + "\n") + Printer.print(PrintChannel.ERRORS, "".join(traceback.TracebackException.from_exception(e).format()) + "\n") if os.path.exists(filename): os.remove(filename)