Skip to content

Commit

Permalink
Enhance verbosity with detailed download progress information (#28)
Browse files Browse the repository at this point in the history
This PR uses yt_dlp's progress_hooks to log information about percentage
completed (`d['_percent_str']`) and download speed (`d['_speed_str']`).
This addition aims to provide more insights into the ongoing download
process, assisting users or developers in monitoring and understanding
the progress of the operation.
  • Loading branch information
chapmanjacobd authored Jan 5, 2024
2 parents 892a803 + 36bc8b1 commit 574a6ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xklb/tube_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ def out_dir(p):
},
}

if args.verbose >= consts.LOG_DEBUG:
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"
func_opts["subtitleslangs"] = args.subtitle_languages
Expand Down

0 comments on commit 574a6ab

Please sign in to comment.