From 53973b4d2cb349d39d6f240911142b330d1dd80d Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 20 May 2022 03:02:25 +0530 Subject: [utils] Fix bug in 0b9c08b47bb5e95c21b067044ace4e824d19a9c2 * Cache of `supports_terminal_sequences` must be reset after enabling VT mode * and move `windows_enable_vt_mode` to utils to avoid cyclic imports --- yt_dlp/YoutubeDL.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yt_dlp/YoutubeDL.py') diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 749cf9402..3dc11463c 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -33,7 +33,6 @@ from .compat import ( compat_str, compat_urllib_error, compat_urllib_request, - windows_enable_vt_mode, ) from .cookies import load_cookies from .downloader import FFmpegFD, get_suitable_downloader, shorten_protocol_name @@ -142,6 +141,7 @@ from .utils import ( url_basename, variadic, version_tuple, + windows_enable_vt_mode, write_json_file, write_string, ) @@ -3605,7 +3605,7 @@ class YoutubeDL: def get_encoding(stream): ret = str(getattr(stream, 'encoding', 'missing (%s)' % type(stream).__name__)) if not supports_terminal_sequences(stream): - from .compat import WINDOWS_VT_MODE # Must be imported locally + from .utils import WINDOWS_VT_MODE # Must be imported locally ret += ' (No VT)' if WINDOWS_VT_MODE is False else ' (No ANSI)' return ret -- cgit v1.2.3