about summary refs log tree commit diff
path: root/youtube_dl/downloader
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-06-15 02:59:15 +0700
committerSergey M․ <dstftw@gmail.com>2018-06-15 02:59:15 +0700
commit9b0b62753432244fd062d99cc5dc604d6bad7877 (patch)
tree4686cfb36242296d440ff6c4b630509d2b77fa62 /youtube_dl/downloader
parent61cb66830f5097b528aab381eb6b343a89f73cbc (diff)
downloadyoutube-dl-9b0b62753432244fd062d99cc5dc604d6bad7877.tar.gz
youtube-dl-9b0b62753432244fd062d99cc5dc604d6bad7877.tar.xz
youtube-dl-9b0b62753432244fd062d99cc5dc604d6bad7877.zip
[downloader/rtmp] Fix downloading in verbose mode (closes #16736)
Diffstat (limited to 'youtube_dl/downloader')
-rw-r--r--youtube_dl/downloader/rtmp.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/youtube_dl/downloader/rtmp.py b/youtube_dl/downloader/rtmp.py
index 9e0ddbb18..fbb7f51b0 100644
--- a/youtube_dl/downloader/rtmp.py
+++ b/youtube_dl/downloader/rtmp.py
@@ -24,13 +24,12 @@ class RtmpFD(FileDownloader):
     def real_download(self, filename, info_dict):
         def run_rtmpdump(args):
             start = time.time()
+            resume_percent = None
+            resume_downloaded_data_len = None
             proc = subprocess.Popen(args, stderr=subprocess.PIPE)
             cursor_in_new_line = True
-
-            def dl():
-                resume_percent = None
-                resume_downloaded_data_len = None
-                proc_stderr_closed = False
+            proc_stderr_closed = False
+            try:
                 while not proc_stderr_closed:
                     # read line from stderr
                     line = ''
@@ -90,12 +89,8 @@ class RtmpFD(FileDownloader):
                                 self.to_screen('')
                             cursor_in_new_line = True
                             self.to_screen('[rtmpdump] ' + line)
-
-            try:
-                dl()
             finally:
                 proc.wait()
-
             if not cursor_in_new_line:
                 self.to_screen('')
             return proc.returncode