1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-02 12:02:52 -05:00

[minicurses] Fix when printing to file

Closes #1215
This commit is contained in:
pukkandan
2021-10-10 07:08:22 +05:30
parent 2e01ba6218
commit d1d5c08f29
4 changed files with 29 additions and 24 deletions

View File

@ -514,6 +514,7 @@ class YoutubeDL(object):
self.cache = Cache(self)
windows_enable_vt_mode()
# FIXME: This will break if we ever print color to stdout
self.params['no_color'] = self.params.get('no_color') or not supports_terminal_sequences(self._err_file)
if sys.version_info < (3, 6):
@ -3298,6 +3299,9 @@ class YoutubeDL(object):
KEYRING_AVAILABLE and 'keyring',
)))) or 'none'
self._write_string('[debug] Optional libraries: %s\n' % lib_str)
self._write_string('[debug] ANSI escape support: stdout = %s, stderr = %s\n' % (
supports_terminal_sequences(self._screen_file),
supports_terminal_sequences(self._err_file)))
proxy_map = {}
for handler in self._opener.handlers: