-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,
)
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:
'eta': eta,
'elapsed': time_now - start,
'speed': speed,
- })
+ }, info_dict)
cursor_in_new_line = False
else:
# no percent for live streams
'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:
self.to_screen('')
return proc.wait()
except BaseException: # Including KeyboardInterrupt
- proc.kill()
- proc.wait()
+ proc.kill(timeout=None)
raise
url = info_dict['url']
# Check for rtmpdump first
if not check_executable('rtmpdump', ['-h']):
- self.report_error('RTMP download detected but "rtmpdump" could not be run. Please install it.')
+ self.report_error('RTMP download detected but "rtmpdump" could not be run. Please install')
return False
# Download using rtmpdump. rtmpdump returns exit code 2 when
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]
'filename': filename,
'status': 'finished',
'elapsed': time.time() - started,
- })
+ }, info_dict)
return True
else:
self.to_stderr('\n')