From 28f1c36da243fb5bb48ccabe727f32cbfc769e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 29 Sep 2021 18:38:45 +0200 Subject: [PATCH] simplify and adjust download progress indicator (#1519) --- gallery_dl/output.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/gallery_dl/output.py b/gallery_dl/output.py index 6e04f1e3..d4d295f0 100644 --- a/gallery_dl/output.py +++ b/gallery_dl/output.py @@ -293,17 +293,13 @@ class TerminalOutput(NullOutput): print("\r", self.shorten(CHAR_SUCCESS + path), sep="") def progress(self, bytes_total, bytes_downloaded, bytes_per_second): + bdl = util.format_value(bytes_downloaded) + bps = util.format_value(bytes_per_second) if bytes_total is None: - print("\r {:>7}B {:>7}B/s \r".format( - util.format_value(bytes_downloaded), - util.format_value(bytes_per_second), - ), end="") + print("\r{:>7}B {:>7}B/s ".format(bdl, bps), end="") else: - print("\r{:>3}% {:>7}B {:>7}B/s \r".format( - bytes_downloaded * 100 // bytes_total, - util.format_value(bytes_downloaded), - util.format_value(bytes_per_second), - ), end="") + print("\r{:>3}% {:>7}B {:>7}B/s ".format( + bytes_downloaded * 100 // bytes_total, bdl, bps), end="") class ColorOutput(TerminalOutput):