1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +00:00

[downloader/ffmpeg] Allow passing custom arguments before -i

Closes #686
This commit is contained in:
pukkandan
2021-08-24 03:15:44 +05:30
parent 91d4b32bb6
commit 330690a214
5 changed files with 34 additions and 27 deletions

View File

@ -5,7 +5,7 @@ import os
from ..compat import compat_str
from ..utils import (
cli_configuration_args,
_configuration_args,
encodeFilename,
PostProcessingError,
)
@ -110,18 +110,9 @@ class PostProcessor(object):
except Exception:
self.report_warning(errnote)
def _configuration_args(self, exe, keys=None, default=[], use_compat=True):
pp_key = self.pp_key().lower()
exe = exe.lower()
root_key = exe if pp_key == exe else '%s+%s' % (pp_key, exe)
keys = ['%s%s' % (root_key, k) for k in (keys or [''])]
if root_key in keys:
keys += [root_key] + ([] if pp_key == exe else [(self.pp_key(), exe)]) + ['default']
else:
use_compat = False
return cli_configuration_args(
self.get_param('postprocessor_args'),
keys, default, use_compat)
def _configuration_args(self, exe, *args, **kwargs):
return _configuration_args(
self.pp_key(), self.get_param('postprocessor_args'), exe, *args, **kwargs)
class AudioConversionError(PostProcessingError):