From b8f6bbe68a6ff1f733a8d71d991b03008dfaf621 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sat, 23 Jan 2021 17:41:21 +0530 Subject: [PATCH] Warn when using old style (downloader/postprocessor)_args --- youtube_dlc/__init__.py | 5 +++++ youtube_dlc/options.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/youtube_dlc/__init__.py b/youtube_dlc/__init__.py index 2072165ce..5bf54b556 100644 --- a/youtube_dlc/__init__.py +++ b/youtube_dlc/__init__.py @@ -326,7 +326,12 @@ def _real_main(argv=None): 'exec_cmd': opts.exec_cmd, }) + _args_compat_warning = 'WARNING: %s given without specifying name. The arguments will be given to all %s\n' + if 'default' in opts.external_downloader_args: + write_string(_args_compat_warning % ('--external-downloader-args', 'external downloaders'), out=sys.stderr), + if 'default-compat' in opts.postprocessor_args and 'default' not in opts.postprocessor_args: + write_string(_args_compat_warning % ('--post-processor-args', 'post-processors'), out=sys.stderr), opts.postprocessor_args.setdefault('sponskrub', []) opts.postprocessor_args['default'] = opts.postprocessor_args['default-compat'] diff --git a/youtube_dlc/options.py b/youtube_dlc/options.py index cb8e8c06d..7a30882f1 100644 --- a/youtube_dlc/options.py +++ b/youtube_dlc/options.py @@ -640,7 +640,9 @@ def parseOpts(overrideArguments=None): '--downloader-args', '--external-downloader-args', metavar='NAME:ARGS', dest='external_downloader_args', default={}, type='str', action='callback', callback=_dict_from_multiple_values_options_callback, - callback_kwargs={'default_key': 'default', 'process': compat_shlex_split}, + callback_kwargs={ + 'allowed_keys': '|'.join(list_external_downloaders()), + 'default_key': 'default', 'process': compat_shlex_split}, help=( 'Give these arguments to the external downloader. ' 'Specify the downloader name and the arguments separated by a colon ":". '