diff options
author | Simon Sawicki <contact@grub4k.xyz> | 2023-03-03 22:36:11 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-03-03 22:55:09 +0530 |
commit | 77df20f14cc9ed41dfe3a1fe2d77fd27f5365a94 (patch) | |
tree | d547cfc8ffffe5cf65ea8f1317f59a344b435435 /yt_dlp/options.py | |
parent | 29cb20bd563c02671b31dd840139e93dd37150a1 (diff) | |
download | hypervideo-pre-77df20f14cc9ed41dfe3a1fe2d77fd27f5365a94.tar.lz hypervideo-pre-77df20f14cc9ed41dfe3a1fe2d77fd27f5365a94.tar.xz hypervideo-pre-77df20f14cc9ed41dfe3a1fe2d77fd27f5365a94.zip |
[update] Add option `--update-to`, including to nightly (#6220)
* By default, stable will only update to stable, and nightly to nightly
Authored by: Grub4K, bashonly, pukkandan
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
Diffstat (limited to 'yt_dlp/options.py')
-rw-r--r-- | yt_dlp/options.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/yt_dlp/options.py b/yt_dlp/options.py index fd60ff55f..b81e14966 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -20,7 +20,7 @@ from .postprocessor import ( SponsorBlockPP, ) from .postprocessor.modify_chapters import DEFAULT_SPONSORBLOCK_CHAPTER_TITLE -from .update import detect_variant, is_non_updateable +from .update import UPDATE_SOURCES, detect_variant, is_non_updateable from .utils import ( OUTTMPL_TYPES, POSTPROCESS_WHEN, @@ -36,7 +36,7 @@ from .utils import ( remove_end, write_string, ) -from .version import __version__ +from .version import CHANNEL, __version__ def parseOpts(overrideArguments=None, ignore_config_files='if_override'): @@ -326,12 +326,19 @@ def create_parser(): action='store_true', dest='update_self', help=format_field( is_non_updateable(), None, 'Check if updates are available. %s', - default='Update this program to the latest version')) + default=f'Update this program to the latest {CHANNEL} version')) general.add_option( '--no-update', action='store_false', dest='update_self', help='Do not check for updates (default)') general.add_option( + '--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 ommited; See "UPDATE" for details. ' + f'Supported channels: {", ".join(UPDATE_SOURCES)}')) + general.add_option( '-i', '--ignore-errors', action='store_true', dest='ignoreerrors', help='Ignore download and postprocessing errors. The download will be considered successful even if the postprocessing fails') |