From da19699ff832318a53387fc70fa4f0e36712e950 Mon Sep 17 00:00:00 2001 From: bibiak <24386585+bibiak1@users.noreply.github.com> Date: Mon, 22 May 2023 21:22:01 +0200 Subject: [PATCH] Update youtube_dl/extractor/tvp.py Co-authored-by: dirkf --- youtube_dl/extractor/tvp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/tvp.py b/youtube_dl/extractor/tvp.py index 1491e1ec9..e861ddbef 100644 --- a/youtube_dl/extractor/tvp.py +++ b/youtube_dl/extractor/tvp.py @@ -116,7 +116,12 @@ if not hasattr(InfoExtractor, '_match_valid_url'): # return self._parse_json(json_string, video_id, ignore_extra=True, **kwargs) return self._parse_json(json_string, video_id, **kwargs) except ExtractorError as e: - msg = 'Unable to extract {0} - Failed to parse JSON'.format(name) + except ExtractorError as e: + if not self._downloader.params.get('no_color') and compat_os_name != 'nt' and sys.stderr.isatty(): + _name = '\033[0;34m%s\033[0m' % name + else: + _name = name + msg = 'Unable to extract {0} - Failed to parse JSON'.format(_name) if fatal: raise ExtractorError(msg, cause=e.cause, video_id=video_id) elif not has_default: