From 6182b3917cecb351f89df3fac21e89af859cb2f5 Mon Sep 17 00:00:00 2001 From: kikuyan Date: Mon, 5 Jul 2021 03:54:42 +0900 Subject: [PATCH] report progress in console titlebar only --- youtube_dl/downloader/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/youtube_dl/downloader/common.py b/youtube_dl/downloader/common.py index 1cdba89cd..29f1afb82 100644 --- a/youtube_dl/downloader/common.py +++ b/youtube_dl/downloader/common.py @@ -229,6 +229,9 @@ class FileDownloader(object): self.to_screen('[download] Destination: ' + filename) def _report_progress_status(self, msg, is_last_line=False): + self.to_console_title('youtube-dl ' + msg) + if self.params.get('noprogress'): + return fullmsg = '[download] ' + msg if self.params.get('progress_with_newline', False): self.to_screen(fullmsg) @@ -243,7 +246,6 @@ class FileDownloader(object): else: clear_line = ('\r\x1b[K' if sys.stderr.isatty() else '\r') self.to_screen(clear_line + fullmsg, skip_eol=not is_last_line) - self.to_console_title('youtube-dl ' + msg) def report_progress(self, s): if s['status'] == 'finished': @@ -260,7 +262,7 @@ class FileDownloader(object): self._report_progress_status( msg_template % s, is_last_line=True) - if self.params.get('noprogress'): + if self.params.get('noprogress') and not self.params.get('consoletitle'): return if s['status'] != 'downloading':