|
|
@ -22,7 +22,7 @@ from ..utils import (
|
|
|
|
cli_option,
|
|
|
|
cli_option,
|
|
|
|
cli_valueless_option,
|
|
|
|
cli_valueless_option,
|
|
|
|
cli_bool_option,
|
|
|
|
cli_bool_option,
|
|
|
|
cli_configuration_args,
|
|
|
|
_configuration_args,
|
|
|
|
encodeFilename,
|
|
|
|
encodeFilename,
|
|
|
|
encodeArgument,
|
|
|
|
encodeArgument,
|
|
|
|
handle_youtubedl_headers,
|
|
|
|
handle_youtubedl_headers,
|
|
|
@ -111,11 +111,10 @@ class ExternalFD(FileDownloader):
|
|
|
|
def _valueless_option(self, command_option, param, expected_value=True):
|
|
|
|
def _valueless_option(self, command_option, param, expected_value=True):
|
|
|
|
return cli_valueless_option(self.params, command_option, param, expected_value)
|
|
|
|
return cli_valueless_option(self.params, command_option, param, expected_value)
|
|
|
|
|
|
|
|
|
|
|
|
def _configuration_args(self, *args, **kwargs):
|
|
|
|
def _configuration_args(self, keys=None, *args, **kwargs):
|
|
|
|
return cli_configuration_args(
|
|
|
|
return _configuration_args(
|
|
|
|
self.params.get('external_downloader_args'),
|
|
|
|
self.get_basename(), self.params.get('external_downloader_args'), self.get_basename(),
|
|
|
|
[self.get_basename(), 'default'],
|
|
|
|
keys, *args, **kwargs)
|
|
|
|
*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _call_downloader(self, tmpfilename, info_dict):
|
|
|
|
def _call_downloader(self, tmpfilename, info_dict):
|
|
|
|
""" Either overwrite this or implement _make_cmd """
|
|
|
|
""" Either overwrite this or implement _make_cmd """
|
|
|
@ -459,10 +458,10 @@ class FFmpegFD(ExternalFD):
|
|
|
|
elif isinstance(conn, compat_str):
|
|
|
|
elif isinstance(conn, compat_str):
|
|
|
|
args += ['-rtmp_conn', conn]
|
|
|
|
args += ['-rtmp_conn', conn]
|
|
|
|
|
|
|
|
|
|
|
|
for url in urls:
|
|
|
|
for i, url in enumerate(urls):
|
|
|
|
args += ['-i', url]
|
|
|
|
args += self._configuration_args((f'_i{i + 1}', '_i')) + ['-i', url]
|
|
|
|
|
|
|
|
|
|
|
|
args += self._configuration_args() + ['-c', 'copy']
|
|
|
|
args += ['-c', 'copy']
|
|
|
|
if info_dict.get('requested_formats'):
|
|
|
|
if info_dict.get('requested_formats'):
|
|
|
|
for (i, fmt) in enumerate(info_dict['requested_formats']):
|
|
|
|
for (i, fmt) in enumerate(info_dict['requested_formats']):
|
|
|
|
if fmt.get('acodec') != 'none':
|
|
|
|
if fmt.get('acodec') != 'none':
|
|
|
@ -491,9 +490,10 @@ class FFmpegFD(ExternalFD):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
args += ['-f', EXT_TO_OUT_FORMATS.get(ext, ext)]
|
|
|
|
args += ['-f', EXT_TO_OUT_FORMATS.get(ext, ext)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
args += self._configuration_args((f'_o1', '_o', ''))
|
|
|
|
|
|
|
|
|
|
|
|
args = [encodeArgument(opt) for opt in args]
|
|
|
|
args = [encodeArgument(opt) for opt in args]
|
|
|
|
args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True))
|
|
|
|
args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True))
|
|
|
|
|
|
|
|
|
|
|
|
self._debug_cmd(args)
|
|
|
|
self._debug_cmd(args)
|
|
|
|
|
|
|
|
|
|
|
|
proc = subprocess.Popen(args, stdin=subprocess.PIPE, env=env)
|
|
|
|
proc = subprocess.Popen(args, stdin=subprocess.PIPE, env=env)
|
|
|
|