From ababc2760d07f0c8ec688431f67df0a23cc843d1 Mon Sep 17 00:00:00 2001 From: Ian Macdonald Date: Tue, 20 Oct 2020 23:52:02 +0200 Subject: Calculate proper download remainder size when resuming a download. (#21) --- samloader/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samloader/main.py b/samloader/main.py index baa9d48..cae0bf4 100644 --- a/samloader/main.py +++ b/samloader/main.py @@ -46,7 +46,7 @@ def main(): if args.show_md5 and "Content-MD5" in r.headers: print("MD5:", base64.b64decode(r.headers["Content-MD5"]).hex()) # TODO: use own progress bar instead of clint - for chunk in progress.bar(r.iter_content(chunk_size=0x10000), expected_size=(size/0x10000)+1): + for chunk in progress.bar(r.iter_content(chunk_size=0x10000), expected_size=((size-dloffset)/0x10000)+1): if chunk: fd.write(chunk) fd.flush() -- cgit v1.2.3