From 16b57647244bbfc4c0711ac274385eed410c62ff Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 5 Jan 2024 12:29:17 -0500 Subject: [PATCH 1/2] Add progress hooks Use yt_dlp's progress_hooks --- xklb/tube_backend.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xklb/tube_backend.py b/xklb/tube_backend.py index f3f1c232..04ae3334 100644 --- a/xklb/tube_backend.py +++ b/xklb/tube_backend.py @@ -349,6 +349,9 @@ def out_dir(p): }, } + if args.verbose >= consts.LOG_DEBUG: + func_opts["progress_hooks"] = [lambda d: log.info(f"downloading {d['_percent_str']} {d['_speed_str']}")] + if args.profile != DBType.audio: func_opts["subtitlesformat"] = "srt/best" func_opts["subtitleslangs"] = args.subtitle_languages From cf1a5f6cfafe02c6b57330c1b4d5c8b752d1f4bd Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 5 Jan 2024 12:47:11 -0500 Subject: [PATCH 2/2] Use debug log level --- xklb/tube_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xklb/tube_backend.py b/xklb/tube_backend.py index 04ae3334..5f25137c 100644 --- a/xklb/tube_backend.py +++ b/xklb/tube_backend.py @@ -350,7 +350,7 @@ def out_dir(p): } if args.verbose >= consts.LOG_DEBUG: - func_opts["progress_hooks"] = [lambda d: log.info(f"downloading {d['_percent_str']} {d['_speed_str']}")] + func_opts["progress_hooks"] = [lambda d: log.debug(f"downloading {d['_percent_str']} {d['_speed_str']}")] if args.profile != DBType.audio: func_opts["subtitlesformat"] = "srt/best"