[downloader:ytdl] prevent crash in '_progress_hook()'

https://github.com/mikf/gallery-dl/discussions/1964#discussioncomment-1516702
pull/1975/head
Mike Fährmann 3 years ago
parent bcbf9bcf36
commit 232ab626a7
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -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…
Cancel
Save