From 50193856c2d399f713a3cc9351d9f8f627abf9fe Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Tue, 21 Feb 2023 06:35:40 +0000 Subject: [PATCH] Add missing tqdm progress bar to DASH downloads --- devine/core/manifests/dash.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index f235bb1..f9f417e 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -18,6 +18,7 @@ from langcodes import Language, tag_is_valid from pywidevine.cdm import Cdm as WidevineCdm from pywidevine.pssh import PSSH from requests import Session +from tqdm import tqdm from devine.core.constants import AnyTrack from devine.core.downloaders import aria2c @@ -392,7 +393,7 @@ class DASH: res.raise_for_status() init_data = res.content - for i, segment_url in enumerate(segment_urls): + for i, segment_url in enumerate(tqdm(segment_urls, unit="segments")): segment_filename = str(i).zfill(len(str(len(segment_urls)))) segment_save_path = (save_dir / segment_filename).with_suffix(".mp4") @@ -447,7 +448,7 @@ class DASH: res.raise_for_status() init_data = res.content - for i, segment_url in enumerate(segment_list.findall("SegmentURL")): + for i, segment_url in enumerate(tqdm(segment_list.findall("SegmentURL"), unit="segments")): segment_filename = str(i).zfill(len(str(len(segment_urls)))) segment_save_path = (save_dir / segment_filename).with_suffix(".mp4")