mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-15 19:16:46 +01:00
parent
e9df3d42c4
commit
f079514957
2 changed files with 10 additions and 8 deletions
|
|
@ -586,7 +586,6 @@ class YoutubeDL:
|
|||
self._playlist_urls = set()
|
||||
self.cache = Cache(self)
|
||||
|
||||
windows_enable_vt_mode()
|
||||
stdout = sys.stderr if self.params.get('logtostderr') else sys.stdout
|
||||
self._out_files = Namespace(
|
||||
out=stdout,
|
||||
|
|
@ -595,6 +594,12 @@ class YoutubeDL:
|
|||
console=None if compat_os_name == 'nt' else next(
|
||||
filter(supports_terminal_sequences, (sys.stderr, sys.stdout)), None)
|
||||
)
|
||||
|
||||
try:
|
||||
windows_enable_vt_mode()
|
||||
except Exception as e:
|
||||
self.write_debug(f'Failed to enable VT mode: {e}')
|
||||
|
||||
self._allow_colors = Namespace(**{
|
||||
type_: not self.params.get('no_color') and supports_terminal_sequences(stream)
|
||||
for type_, stream in self._out_files.items_ if type_ != 'console'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue