From 4a5aebbca73524bc79bb68dda21e4b1e24f51da6 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 25 Feb 2023 14:01:25 +0000 Subject: [PATCH] Add a total elapsed timer to the final log of dl command --- devine/commands/dl.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/devine/commands/dl.py b/devine/commands/dl.py index 691d89e..e1d52b9 100644 --- a/devine/commands/dl.py +++ b/devine/commands/dl.py @@ -266,6 +266,8 @@ class dl: *_: Any, **__: Any ) -> None: + start_time = time.time() + if cdm_only is None: vaults_only = None else: @@ -490,7 +492,14 @@ class dl: cookie_jar.set_cookie(cookie) cookie_jar.save(ignore_discard=True) - console.log("Processed all titles!") + minutes, seconds = divmod(int(time.time() - start_time), 60) + hours, minutes = divmod(minutes, 60) + time_string = (f"{hours:d}h" if hours else "") + f"{minutes:d}m{seconds:d}s" + + console.log(Padding( + f"Processed all titles in [progress.elapsed]{time_string}", + (0, 0, 1, 0) + )) def prepare_drm( self,