mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-30 14:15:13 +00:00
Improved progress reporting (See desc) (#1125)
* Separate `--console-title` and `--no-progress` * Add option `--progress` to show progress-bar even in quiet mode * Fix and refactor `minicurses` * Use `minicurses` for all progress reporting * Standardize use of terminal sequences and enable color support for windows 10 * Add option `--progress-template` to customize progress-bar and console-title * Add postprocessor hooks and progress reporting Closes: #906, #901, #1085, #1170
This commit is contained in:
@@ -910,12 +910,30 @@ def parseOpts(overrideArguments=None):
|
||||
help='Output progress bar as new lines')
|
||||
verbosity.add_option(
|
||||
'--no-progress',
|
||||
action='store_true', dest='noprogress', default=False,
|
||||
action='store_true', dest='noprogress', default=None,
|
||||
help='Do not print progress bar')
|
||||
verbosity.add_option(
|
||||
'--progress',
|
||||
action='store_false', dest='noprogress',
|
||||
help='Show progress bar, even if in quiet mode')
|
||||
verbosity.add_option(
|
||||
'--console-title',
|
||||
action='store_true', dest='consoletitle', default=False,
|
||||
help='Display progress in console titlebar')
|
||||
verbosity.add_option(
|
||||
'--progress-template',
|
||||
metavar='[TYPES:]TEMPLATE', dest='progress_template', default={}, type='str',
|
||||
action='callback', callback=_dict_from_options_callback,
|
||||
callback_kwargs={
|
||||
'allowed_keys': '(download|postprocess)(-title)?',
|
||||
'default_key': 'download'
|
||||
}, help=(
|
||||
'Template for progress outputs, optionally prefixed with one of "download:" (default), '
|
||||
'"download-title:" (the console title), "postprocess:", or "postprocess-title:". '
|
||||
'The video\'s fields are accessible under the "info" key and '
|
||||
'the progress attributes are accessible under "progress" key. Eg: '
|
||||
# TODO: Document the fields inside "progress"
|
||||
'--console-title --progress-template "download-title:%(info.id)s-%(progress.eta)s"'))
|
||||
verbosity.add_option(
|
||||
'-v', '--verbose',
|
||||
action='store_true', dest='verbose', default=False,
|
||||
|
||||
Reference in New Issue
Block a user