From 8e3a678967267c3df7de9bf4cc46562141b15057 Mon Sep 17 00:00:00 2001 From: Peter Taylor Date: Thu, 5 May 2022 11:19:42 +0100 Subject: [PATCH] Added Progress Option --- itchiodl/library.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/itchiodl/library.py b/itchiodl/library.py index a401025..687f7e7 100644 --- a/itchiodl/library.py +++ b/itchiodl/library.py @@ -1,5 +1,6 @@ import json from concurrent.futures import ThreadPoolExecutor +import re import requests from itchiodl.game import Game @@ -38,9 +39,13 @@ class Library: def download_library(self, platform=None): """Download all games in the library""" - with ThreadPoolExecutor(max_workers=self.jobs) as executor: + with ThreadPoolExecutor(max_workers=self.jobs) as executor: + i = 0 + l = len(self.games) def dl(g): - return g.download(self.login, platform) + x = g.download(self.login, platform) + print(f"Downloaded {i} games of {l}") + return x executor.map(dl, self.games)