mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-12 02:16:05 +00:00
Remove comma seperated support
This commit is contained in:
parent
18608214f0
commit
afa79173cd
@ -328,12 +328,9 @@ def create_parser():
|
|||||||
def _preset_alias_callback(option, opt_str, value, parser):
|
def _preset_alias_callback(option, opt_str, value, parser):
|
||||||
if not value:
|
if not value:
|
||||||
return
|
return
|
||||||
if isinstance(value, str):
|
if value not in PRESET_ALIASES:
|
||||||
value = value.split(',')
|
raise optparse.OptionValueError(f'Unknown preset alias: {value}')
|
||||||
for alias in value:
|
parser.rargs[:0] = PRESET_ALIASES[value]
|
||||||
if alias not in PRESET_ALIASES:
|
|
||||||
raise optparse.OptionValueError(f'Unknown preset alias: {alias}')
|
|
||||||
parser.rargs[:0] = PRESET_ALIASES[alias]
|
|
||||||
|
|
||||||
general = optparse.OptionGroup(parser, 'General Options')
|
general = optparse.OptionGroup(parser, 'General Options')
|
||||||
general.add_option(
|
general.add_option(
|
||||||
@ -541,8 +538,9 @@ def create_parser():
|
|||||||
metavar='PRESET', dest='_', type='str',
|
metavar='PRESET', dest='_', type='str',
|
||||||
action='callback', callback=_preset_alias_callback,
|
action='callback', callback=_preset_alias_callback,
|
||||||
help=(
|
help=(
|
||||||
'Applies a predefined preset. The preset is a comma separated list of aliases,'
|
'Applies a predefined preset. e.g. --preset-alias mp3. '
|
||||||
f' e.g. --preset-alias mp3,embed. The following presets are available: {", ".join(PRESET_ALIASES)}.'))
|
f'The following presets are available: {", ".join(PRESET_ALIASES)}. '
|
||||||
|
'This option can be used multiple times.'))
|
||||||
|
|
||||||
network = optparse.OptionGroup(parser, 'Network Options')
|
network = optparse.OptionGroup(parser, 'Network Options')
|
||||||
network.add_option(
|
network.add_option(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user