From ee56dd71ac36084c8db87b07308ca3d48ac7ed60 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Fri, 10 Feb 2023 13:15:28 -0700 Subject: [PATCH] fix some logging stuff --- downloader.py | 10 ++++++++-- process/threads.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/downloader.py b/downloader.py index 179aefa..f97d291 100755 --- a/downloader.py +++ b/downloader.py @@ -245,11 +245,17 @@ class ytdl_logger(object): def warning(self, msg): file_logger.warning(self.__clean_msg(msg)) - log_bar(msg, 'warning') + if args.daemon: + logger.warning(msg) + else: + status_bar.write(msg) def error(self, msg): file_logger.error(self.__clean_msg(msg)) - log_bar(msg, 'error') + if args.daemon: + logger.error(msg) + else: + status_bar.write(msg) def __clean_msg(self, msg): return ansi_escape_regex.sub('', msg) diff --git a/process/threads.py b/process/threads.py index f54c6d4..bd7e7b7 100644 --- a/process/threads.py +++ b/process/threads.py @@ -103,7 +103,7 @@ def download_video(args) -> dict: yt_dlp = ydl.YDL(kwargs['ydl_opts']) video_n = yt_dlp.get_info(video['url']) if not video_n: - output_dict['video_critical_err_msg_short'].append('failed to get info.') + output_dict['video_critical_err_msg_short'].append('failed to get info. Unavailable?') return output_dict video_n['url'] = video['url'] video = video_n