mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-02 09:41:07 +00:00
fallback to estimate size for progress hook
This commit is contained in:
parent
a56de2818d
commit
a459661fa2
@ -293,8 +293,11 @@ class VideoDownloader:
|
|||||||
title = "Downloading: " + response["info_dict"]["title"]
|
title = "Downloading: " + response["info_dict"]["title"]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
size = response.get("_total_bytes_str")
|
||||||
|
if size.strip() == "N/A":
|
||||||
|
size = response.get("_total_bytes_estimate_str", "N/A")
|
||||||
|
|
||||||
percent = response["_percent_str"]
|
percent = response["_percent_str"]
|
||||||
size = response["_total_bytes_str"]
|
|
||||||
speed = response["_speed_str"]
|
speed = response["_speed_str"]
|
||||||
eta = response["_eta_str"]
|
eta = response["_eta_str"]
|
||||||
message = f"{percent} of {size} at {speed} - time left: {eta}"
|
message = f"{percent} of {size} at {speed} - time left: {eta}"
|
||||||
|
Loading…
Reference in New Issue
Block a user