[YoutubeDL] Write static debug to stderr and respect quiet for dynamic debug (closes...
authorSergey M․ <dstftw@gmail.com>
Sat, 28 Nov 2020 20:55:49 +0000 (03:55 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 28 Nov 2020 21:04:06 +0000 (04:04 +0700)
TODO: logging and verbosity needs major refactoring (refs #10894)

youtube_dl/YoutubeDL.py

index 855a73157a1ae24e11deb68ddfe8d5f618c6b5f9..fdd68f616695f664b3a23ab23099e2a77415b149 100755 (executable)
@@ -1610,7 +1610,7 @@ class YoutubeDL(object):
         if req_format is None:
             req_format = self._default_format_spec(info_dict, download=download)
             if self.params.get('verbose'):
-                self.to_stdout('[debug] Default format spec: %s' % req_format)
+                self._write_string('[debug] Default format spec: %s\n' % req_format)
 
         format_selector = self.build_format_selector(req_format)
 
@@ -1871,7 +1871,7 @@ class YoutubeDL(object):
                     for ph in self._progress_hooks:
                         fd.add_progress_hook(ph)
                     if self.params.get('verbose'):
-                        self.to_stdout('[debug] Invoking downloader on %r' % info.get('url'))
+                        self.to_screen('[debug] Invoking downloader on %r' % info.get('url'))
                     return fd.download(name, info)
 
                 if info_dict.get('requested_formats') is not None: