From 8e79f6c27128ce9ef7aed28ddb3cac59eca3e701 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 25 Aug 2024 15:55:48 +0200 Subject: docs(yt_dlp/progress_hook): Add a note about the possibility to calculate video sizes --- crates/yt_dlp/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/yt_dlp/src/lib.rs') diff --git a/crates/yt_dlp/src/lib.rs b/crates/yt_dlp/src/lib.rs index 7e11600..b0dffa4 100644 --- a/crates/yt_dlp/src/lib.rs +++ b/crates/yt_dlp/src/lib.rs @@ -208,6 +208,13 @@ pub fn progress_hook<'a>(py: Python, input: Bound<'_, PyDict>) -> PyResult<()> { estimate } else { total_bytes + // FIXME: The solution below _would_ work, if we had a info_json with the + // values. <2024-08-24> + // + // let duration = default_get! {as_f64, 0.0, "duration"}.ceil() as u64; + // // TODO: yt_dlp gets this from the format + // let tbr = default_get! {as_f64, 0.0, "tbr"}.ceil() as u64; + // duration * tbr * (1000 / 8) } }; let percent: f64 = { -- cgit 1.4.1