mirror of
				https://github.com/ytdl-org/youtube-dl.git
				synced 2025-10-29 09:26:20 -07:00 
			
		
		
		
	[downloader/rtmp] Fix downloading in verbose mode (closes #16736)
This commit is contained in:
		| @@ -24,13 +24,12 @@ class RtmpFD(FileDownloader): | |||||||
|     def real_download(self, filename, info_dict): |     def real_download(self, filename, info_dict): | ||||||
|         def run_rtmpdump(args): |         def run_rtmpdump(args): | ||||||
|             start = time.time() |             start = time.time() | ||||||
|  |             resume_percent = None | ||||||
|  |             resume_downloaded_data_len = None | ||||||
|             proc = subprocess.Popen(args, stderr=subprocess.PIPE) |             proc = subprocess.Popen(args, stderr=subprocess.PIPE) | ||||||
|             cursor_in_new_line = True |             cursor_in_new_line = True | ||||||
|  |             proc_stderr_closed = False | ||||||
|             def dl(): |             try: | ||||||
|                 resume_percent = None |  | ||||||
|                 resume_downloaded_data_len = None |  | ||||||
|                 proc_stderr_closed = False |  | ||||||
|                 while not proc_stderr_closed: |                 while not proc_stderr_closed: | ||||||
|                     # read line from stderr |                     # read line from stderr | ||||||
|                     line = '' |                     line = '' | ||||||
| @@ -90,12 +89,8 @@ class RtmpFD(FileDownloader): | |||||||
|                                 self.to_screen('') |                                 self.to_screen('') | ||||||
|                             cursor_in_new_line = True |                             cursor_in_new_line = True | ||||||
|                             self.to_screen('[rtmpdump] ' + line) |                             self.to_screen('[rtmpdump] ' + line) | ||||||
|  |  | ||||||
|             try: |  | ||||||
|                 dl() |  | ||||||
|             finally: |             finally: | ||||||
|                 proc.wait() |                 proc.wait() | ||||||
|  |  | ||||||
|             if not cursor_in_new_line: |             if not cursor_in_new_line: | ||||||
|                 self.to_screen('') |                 self.to_screen('') | ||||||
|             return proc.returncode |             return proc.returncode | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user