From fba70dcf188795a0f22270aafb890065d71a50b8 Mon Sep 17 00:00:00 2001 From: Serene-Arc Date: Sun, 2 May 2021 19:49:32 +1000 Subject: [PATCH] Intercept youtube-dl output --- bdfr/site_downloaders/youtube.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bdfr/site_downloaders/youtube.py b/bdfr/site_downloaders/youtube.py index 7b62dc1..482d4bc 100644 --- a/bdfr/site_downloaders/youtube.py +++ b/bdfr/site_downloaders/youtube.py @@ -30,7 +30,10 @@ class Youtube(BaseDownloader): return [out] def _download_video(self, ytdl_options: dict) -> Resource: + yt_logger = logging.getLogger('youtube-dl') + yt_logger.setLevel(logging.CRITICAL) ytdl_options['quiet'] = True + ytdl_options['logger'] = yt_logger with tempfile.TemporaryDirectory() as temp_dir: download_path = Path(temp_dir).resolve() ytdl_options['outtmpl'] = str(download_path) + '/' + 'test.%(ext)s'