diff --git a/pyproject.toml b/pyproject.toml index 1f0f3ac..54d5549 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "itchio" -version = "1.0.1" +version = "1.0.2" description = "Python Scripts for downloading / archiving your itchio library" authors = ["Peter Taylor "] license = "MIT" diff --git a/src/itchio/game.py b/src/itchio/game.py index a3364ec..b5b79d7 100644 --- a/src/itchio/game.py +++ b/src/itchio/game.py @@ -55,5 +55,10 @@ class Game: # Download file = d['filename'] or d['display_name'] or d['id'] + outfile = f"{self.publisher_slug}/{self.game_slug}/{file}" + if os.path.exists(outfile): + print(f"Skipping {outfile}") + continue + url = f"https://api.itch.io/uploads/{d['id']}/download?api_key={token}&download_key_id={self.id}&uuid={j['uuid']}" - itchio.utils.download_url(url, f"{self.publisher_slug}/{self.game_slug}/{file}", self.name +" - "+file) + itchio.utils.download_url(url, outfile, self.name +" - "+file)