1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-16 14:35:15 +00:00

[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>
This commit is contained in:
Simon Sawicki
2023-03-03 22:36:11 +05:30
committed by pukkandan
parent 29cb20bd56
commit 77df20f14c
6 changed files with 150 additions and 43 deletions

View File

@@ -931,7 +931,7 @@ def _real_main(argv=None):
if opts.rm_cachedir:
ydl.cache.remove()
updater = Updater(ydl)
updater = Updater(ydl, opts.update_self if isinstance(opts.update_self, str) else None)
if opts.update_self and updater.update() and actual_use:
if updater.cmd:
return updater.restart()