mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 18:53:21 +01:00
[downloader:ytdl] prevent crash in '_progress_hook()'
https://github.com/mikf/gallery-dl/discussions/1964#discussioncomment-1516702
This commit is contained in:
parent
bcbf9bcf36
commit
232ab626a7
@ -136,8 +136,9 @@ class YoutubeDLDownloader(DownloaderBase):
|
||||
def _progress_hook(self, info):
|
||||
if info["status"] == "downloading" and \
|
||||
info["elapsed"] >= self.progress:
|
||||
total = info.get("total_bytes") or info.get("total_bytes_estimate")
|
||||
self.out.progress(
|
||||
info["total_bytes"],
|
||||
None if total is None else int(total),
|
||||
info["downloaded_bytes"],
|
||||
int(info["speed"]),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user