aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-05-04 21:09:36 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-05-04 22:38:10 +0530
commit848887eb7afc98580acc7a01fc79ceccfc70d964 (patch)
tree1789a3df6d673c711aa9386f3146aa91853f4399
parent3158150cb758f4b0a582a2bccf2bc88385e27a27 (diff)
downloadhypervideo-pre-848887eb7afc98580acc7a01fc79ceccfc70d964.tar.lz
hypervideo-pre-848887eb7afc98580acc7a01fc79ceccfc70d964.tar.xz
hypervideo-pre-848887eb7afc98580acc7a01fc79ceccfc70d964.zip
[downloader] Fix `quiet` and `to_stderr`
-rw-r--r--yt_dlp/YoutubeDL.py8
-rw-r--r--yt_dlp/downloader/common.py4
2 files changed, 7 insertions, 5 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 9d29afb9a..0af036458 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -642,16 +642,18 @@ class YoutubeDL(object):
def to_screen(self, message, skip_eol=False):
"""Print message to stdout if not in quiet mode."""
- return self.to_stdout(message, skip_eol, check_quiet=True)
+ return self.to_stdout(
+ message, skip_eol,
+ quiet=self.params.get('quiet', False))
def _write_string(self, s, out=None):
write_string(s, out=out, encoding=self.params.get('encoding'))
- def to_stdout(self, message, skip_eol=False, check_quiet=False):
+ def to_stdout(self, message, skip_eol=False, quiet=False):
"""Print message to stdout if not in quiet mode."""
if self.params.get('logger'):
self.params['logger'].debug(message)
- elif not check_quiet or not self.params.get('quiet', False):
+ elif not quiet:
message = self._bidi_workaround(message)
terminator = ['\n', ''][skip_eol]
output = message + terminator
diff --git a/yt_dlp/downloader/common.py b/yt_dlp/downloader/common.py
index 8b16ad854..0cf7b13e6 100644
--- a/yt_dlp/downloader/common.py
+++ b/yt_dlp/downloader/common.py
@@ -147,10 +147,10 @@ class FileDownloader(object):
return int(round(number * multiplier))
def to_screen(self, *args, **kargs):
- self.ydl.to_screen(*args, **kargs)
+ self.ydl.to_stdout(*args, quiet=self.params.get('quiet'), **kargs)
def to_stderr(self, message):
- self.ydl.to_screen(message)
+ self.ydl.to_stderr(message)
def to_console_title(self, message):
self.ydl.to_console_title(message)