1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-17 13:38:55 +00:00

Merge remote-tracking branch 'origin' into yt-live-from-start-range

This commit is contained in:
Elyse
2023-06-03 14:39:32 -06:00
98 changed files with 7110 additions and 3283 deletions

View File

@@ -34,6 +34,7 @@ from .utils import (
join_nonempty,
orderedSet_from_options,
remove_end,
variadic,
write_string,
)
from .version import CHANNEL, __version__
@@ -250,7 +251,7 @@ def create_parser():
if multiple_args:
val = [val, *value[1:]]
elif default_key is not None:
keys, val = [default_key], value
keys, val = variadic(default_key), value
else:
raise optparse.OptionValueError(
f'wrong {opt_str} formatting; it should be {option.metavar}, not "{value}"')
@@ -323,7 +324,7 @@ def create_parser():
help='Print program version and exit')
general.add_option(
'-U', '--update',
action='store_true', dest='update_self',
action='store_const', dest='update_self', const=CHANNEL,
help=format_field(
is_non_updateable(), None, 'Check if updates are available. %s',
default=f'Update this program to the latest {CHANNEL} version'))
@@ -335,9 +336,9 @@ def create_parser():
'--update-to',
action='store', dest='update_self', metavar='[CHANNEL]@[TAG]',
help=(
'Upgrade/downgrade to a specific version. CHANNEL and TAG defaults to '
f'"{CHANNEL}" and "latest" respectively if omitted; See "UPDATE" for details. '
f'Supported channels: {", ".join(UPDATE_SOURCES)}'))
'Upgrade/downgrade to a specific version. CHANNEL can be a repository as well. '
f'CHANNEL and TAG default to "{CHANNEL.partition("@")[0]}" and "latest" respectively if omitted; '
f'See "UPDATE" for details. Supported channels: {", ".join(UPDATE_SOURCES)}'))
general.add_option(
'-i', '--ignore-errors',
action='store_true', dest='ignoreerrors',
@@ -411,7 +412,7 @@ def create_parser():
general.add_option(
'--no-flat-playlist',
action='store_false', dest='extract_flat',
help='Extract the videos of a playlist')
help='Fully extract the videos of a playlist (default)')
general.add_option(
'--live-from-start',
action='store_true', dest='live_from_start',
@@ -447,8 +448,25 @@ def create_parser():
help='Do not mark videos watched (default)')
general.add_option(
'--no-colors', '--no-colours',
action='store_true', dest='no_color', default=False,
help='Do not emit color codes in output (Alias: --no-colours)')
action='store_const', dest='color', const={
'stdout': 'no_color',
'stderr': 'no_color',
},
help=optparse.SUPPRESS_HELP)
general.add_option(
'--color',
dest='color', metavar='[STREAM:]POLICY', default={}, type='str',
action='callback', callback=_dict_from_options_callback,
callback_kwargs={
'allowed_keys': 'stdout|stderr',
'default_key': ['stdout', 'stderr'],
'process': str.strip,
}, help=(
'Whether to emit color codes in output, optionally prefixed by '
'the STREAM (stdout or stderr) to apply the setting to. '
'Can be one of "always", "auto" (default), "never", or '
'"no_color" (use non color terminal sequences). '
'Can be used multiple times'))
general.add_option(
'--compat-options',
metavar='OPTS', dest='compat_opts', default=set(), type='str',
@@ -528,11 +546,11 @@ def create_parser():
help=optparse.SUPPRESS_HELP)
geo.add_option(
'--xff', metavar='VALUE',
dest='geo_bypass', default="default",
dest='geo_bypass', default='default',
help=(
'How to fake X-Forwarded-For HTTP header to try bypassing geographic restriction. '
'One of "default" (Only when known to be useful), "never", '
'a two-letter ISO 3166-2 country code, or an IP block in CIDR notation'))
'One of "default" (only when known to be useful), "never", '
'an IP block in CIDR notation, or a two-letter ISO 3166-2 country code'))
geo.add_option(
'--geo-bypass',
action='store_const', dest='geo_bypass', const='default',
@@ -624,7 +642,7 @@ def create_parser():
'that contains the phrase "cats & dogs" (caseless). '
'Use "--match-filter -" to interactively ask whether to download each video'))
selection.add_option(
'--no-match-filter',
'--no-match-filters',
dest='match_filter', action='store_const', const=None,
help='Do not use any --match-filter (default)')
selection.add_option(