fix some logging stuff
This commit is contained in:
parent
85dd1f5603
commit
ee56dd71ac
|
@ -245,11 +245,17 @@ class ytdl_logger(object):
|
||||||
|
|
||||||
def warning(self, msg):
|
def warning(self, msg):
|
||||||
file_logger.warning(self.__clean_msg(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):
|
def error(self, msg):
|
||||||
file_logger.error(self.__clean_msg(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):
|
def __clean_msg(self, msg):
|
||||||
return ansi_escape_regex.sub('', msg)
|
return ansi_escape_regex.sub('', msg)
|
||||||
|
|
|
@ -103,7 +103,7 @@ def download_video(args) -> dict:
|
||||||
yt_dlp = ydl.YDL(kwargs['ydl_opts'])
|
yt_dlp = ydl.YDL(kwargs['ydl_opts'])
|
||||||
video_n = yt_dlp.get_info(video['url'])
|
video_n = yt_dlp.get_info(video['url'])
|
||||||
if not video_n:
|
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
|
return output_dict
|
||||||
video_n['url'] = video['url']
|
video_n['url'] = video['url']
|
||||||
video = video_n
|
video = video_n
|
||||||
|
|
Reference in New Issue