]> 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 6dca64725d7f3f6f02bdc7861e3be1d02a6f52e1..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:
@@ -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]