show warning msg if in daemon and silent mode

This commit is contained in:
Cyberes 2023-01-22 12:28:17 -07:00
parent e7812ce210
commit 0ffe2966b0
2 changed files with 4 additions and 1 deletions

View File

@ -251,6 +251,9 @@ while True:
logger.error(line)
else:
playlist_bar.write(line)
elif not args.silence_errors and args.daemon:
logger.error(f"{result['video_id']} failed due to error.")
if len(result['video_error_logger_msg']):
errored_videos += 1

View File

@ -80,7 +80,7 @@ def download_video(args) -> dict:
ylogger = ytdl_logger(setup_file_logger(video['id'], kwargs['output_dir'] / f"[{video['id']}].log"))
kwargs['ydl_opts']['logger'] = ylogger
yt_dlp = ydl.YDL(kwargs['ydl_opts'])
output_dict = {'downloaded_video_id': None, 'blacklist_video_id': None, 'video_error_logger_msg': [], 'status_msg': [], 'logger_msg': []} # empty object
output_dict = {'downloaded_video_id': None, 'video_id': video['id'], 'video_error_logger_msg': [], 'status_msg': [], 'logger_msg': []} # empty object
start_time = time.time()
try: