]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/downloader/rtmp.py
[compat] Remove deprecated functions from core code
[yt-dlp.git] / yt_dlp / downloader / rtmp.py
index 99158e621518c9b734a4ff5c9bf4882dfe63b26d..0e09525991ff489917f3ab16be18ec87f2999757 100644 (file)
@@ -1,16 +1,14 @@
-from __future__ import unicode_literals
-
 import os
 import re
 import subprocess
 import time
 
 from .common import FileDownloader
-from ..compat import compat_str
 from ..utils import (
+    Popen,
     check_executable,
-    encodeFilename,
     encodeArgument,
+    encodeFilename,
     get_exe_version,
 )
 
@@ -26,7 +24,7 @@ def run_rtmpdump(args):
             start = time.time()
             resume_percent = None
             resume_downloaded_data_len = None
-            proc = subprocess.Popen(args, stderr=subprocess.PIPE)
+            proc = Popen(args, stderr=subprocess.PIPE)
             cursor_in_new_line = True
             proc_stderr_closed = False
             try:
@@ -66,7 +64,7 @@ def run_rtmpdump(args):
                             'eta': eta,
                             'elapsed': time_now - start,
                             'speed': speed,
-                        })
+                        }, info_dict)
                         cursor_in_new_line = False
                     else:
                         # no percent for live streams
@@ -82,7 +80,7 @@ def run_rtmpdump(args):
                                 'status': 'downloading',
                                 'elapsed': time_now - start,
                                 'speed': speed,
-                            })
+                            }, info_dict)
                             cursor_in_new_line = False
                         elif self.params.get('verbose', False):
                             if not cursor_in_new_line:
@@ -93,8 +91,7 @@ def run_rtmpdump(args):
                     self.to_screen('')
                 return proc.wait()
             except BaseException:  # Including KeyboardInterrupt
-                proc.kill()
-                proc.wait()
+                proc.kill(timeout=None)
                 raise
 
         url = info_dict['url']
@@ -145,7 +142,7 @@ def run_rtmpdump(args):
         if isinstance(conn, list):
             for entry in conn:
                 basic_args += ['--conn', entry]
-        elif isinstance(conn, compat_str):
+        elif isinstance(conn, str):
             basic_args += ['--conn', conn]
         if protocol is not None:
             basic_args += ['--protocol', protocol]
@@ -208,7 +205,7 @@ def run_rtmpdump(args):
                 'filename': filename,
                 'status': 'finished',
                 'elapsed': time.time() - started,
-            })
+            }, info_dict)
             return True
         else:
             self.to_stderr('\n')