diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-07-16 22:11:16 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-07-16 22:12:28 +0530 |
commit | a7dc6a89f66c9bf3c8cff5ef7c8e775d57a5b917 (patch) | |
tree | 5822a777bba2454d9ff064e8ff70cf10157c7f3b | |
parent | 5200976949b93bc937a95d4453985e5e1a1160e2 (diff) | |
download | hypervideo-pre-a7dc6a89f66c9bf3c8cff5ef7c8e775d57a5b917.tar.lz hypervideo-pre-a7dc6a89f66c9bf3c8cff5ef7c8e775d57a5b917.tar.xz hypervideo-pre-a7dc6a89f66c9bf3c8cff5ef7c8e775d57a5b917.zip |
Support `--no-progress` for `--wait-for-video`
Closes #4365
-rw-r--r-- | yt_dlp/YoutubeDL.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index a52e8b668..ffc5ff8c0 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -439,12 +439,13 @@ class YoutubeDL: * title: Section title (Optional) * index: Section number (Optional) force_keyframes_at_cuts: Re-encode the video when downloading ranges to get precise cuts + noprogress: Do not print the progress bar The following parameters are not used by YoutubeDL itself, they are used by the downloader (see yt_dlp/downloader/common.py): nopart, updatetime, buffersize, ratelimit, throttledratelimit, min_filesize, max_filesize, test, noresizebuffer, retries, file_access_retries, fragment_retries, - continuedl, noprogress, xattr_set_filesize, hls_use_mpegts, http_chunk_size, + continuedl, xattr_set_filesize, hls_use_mpegts, http_chunk_size, external_downloader_args, concurrent_fragment_downloads. The following options are used by the post processors: @@ -1468,7 +1469,12 @@ class YoutubeDL: def progress(msg): nonlocal last_msg - self.to_screen(msg + ' ' * (len(last_msg) - len(msg)) + '\r', skip_eol=True) + full_msg = f'{msg}\n' + if not self.params.get('noprogress'): + full_msg = msg + ' ' * (len(last_msg) - len(msg)) + '\r' + elif last_msg: + return + self.to_screen(full_msg, skip_eol=True) last_msg = msg min_wait, max_wait = self.params.get('wait_for_video') |