From 822d66e591341f8bf082be371b4beb66d72ba080 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Mon, 22 Aug 2022 04:37:23 +0530 Subject: [PATCH] Fix bug in `--alias` --- yt_dlp/options.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/options.py b/yt_dlp/options.py index 9d75c39769..6373ff8c0a 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -303,10 +303,11 @@ def _create_alias(option, opt_str, value, parser): parser.add_option_group(alias_group) aliases = (x if x.startswith('-') else f'--{x}' for x in map(str.strip, aliases.split(','))) + DEST = '_triggered_aliases' + setattr(parser.values, DEST, collections.defaultdict(int)) try: alias_group.add_option( - *aliases, help=opts, nargs=nargs, type='str' if nargs else None, - dest='_triggered_aliases', default=collections.defaultdict(int), + *aliases, help=opts, nargs=nargs, dest=DEST, type='str' if nargs else None, metavar=' '.join(f'ARG{i}' for i in range(nargs)), action='callback', callback=_alias_callback, callback_kwargs={'opts': opts, 'nargs': nargs}) except Exception as err: