From 38b7cf51575deae6e520121f9b099dd7247f6633 Mon Sep 17 00:00:00 2001 From: Simon Sawicki Date: Tue, 12 Nov 2024 21:27:39 +0100 Subject: [PATCH] docs --- yt_dlp/YoutubeDL.py | 10 ++++++---- yt_dlp/downloader/common.py | 3 ++- yt_dlp/postprocessor/common.py | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 5daa35bcb..b110f7847 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -977,8 +977,9 @@ def restore_console_title(self): def __enter__(self): self.save_console_title() if self.params.get('consoletitle'): - # Set progress bar to "indeterminate" - self._send_console_code('\033]9;4;3\007') + # Set progress to "indeterminate" + # See: https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC + self._send_console_code('\033]9;4;3;0\007') return self def save_cookies(self): @@ -988,8 +989,9 @@ def save_cookies(self): def __exit__(self, *args): self.restore_console_title() if self.params.get('consoletitle'): - # Set progress bar to "disabled" - self._send_console_code('\033]9;4;0\007') + # Set progress to "disabled" + # See: https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC + self._send_console_code('\033]9;4;0;0\007') self.close() def close(self): diff --git a/yt_dlp/downloader/common.py b/yt_dlp/downloader/common.py index c1291b29b..792d4b64a 100644 --- a/yt_dlp/downloader/common.py +++ b/yt_dlp/downloader/common.py @@ -340,8 +340,9 @@ def _report_progress_status(self, s, default_template): percent = s.get('_percent') if s['status'] not in ('downloading', 'error', 'finished') or percent is None: return + # Emit ConEmu progress codes: https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC if s['status'] == 'finished': - self.ydl._send_console_code('\033]9;4;3\007') + self.ydl._send_console_code('\033]9;4;3;0\007') return state = 1 if s['status'] == 'downloading' else 2 self.ydl._send_console_code(f'\033]9;4;{state};{int(percent)}\007') diff --git a/yt_dlp/postprocessor/common.py b/yt_dlp/postprocessor/common.py index 604c811a7..902b4b5ff 100644 --- a/yt_dlp/postprocessor/common.py +++ b/yt_dlp/postprocessor/common.py @@ -195,8 +195,9 @@ def report_progress(self, s): percent = s.get('_percent') if s['status'] not in ('downloading', 'error', 'finished') or percent is None: return + # Emit ConEmu progress codes: https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC if s['status'] == 'finished': - self._downloader._send_console_code('\033]9;4;3\007') + self._downloader._send_console_code('\033]9;4;3;0\007') return state = 1 if s['status'] == 'downloading' else 2 self._downloader._send_console_code(f'\033]9;4;{state};{int(percent)}\007')