diff --git a/itchiodl/game.py b/itchiodl/game.py index a36856f..3061df9 100644 --- a/itchiodl/game.py +++ b/itchiodl/game.py @@ -52,9 +52,8 @@ class Game: print(f"Skipping {self.name} for platform {d['traits']}") continue - file = d['filename'] or d['display_name'] or d['id'] - path = itchiodl.utils.clean_path( - f"{self.publisher_slug}/{self.game_slug}") + file = itchiodl.utils.clean_path(d['filename'] or d['display_name'] or d['id']) + path = f"{self.publisher_slug}/{self.game_slug}" if os.path.exists(f"{path}/{file}"): print(f"Skipping {path}/{file}") continue diff --git a/itchiodl/utils.py b/itchiodl/utils.py index a2d20e5..1afd543 100644 --- a/itchiodl/utils.py +++ b/itchiodl/utils.py @@ -29,15 +29,6 @@ def download(url, path, name, file): else: filename = filename_re.group(1) - total_length = int(rsp.headers.get('content-length')) - - if os.path.exists(f"{path}/{filename}"): - if os.path.getsize(f"{path}/{filename}") == total_length: - print(f"{filename} already exists, skipping") - return f"{path}/{filename}", False - else: - print(f"{filename} exists but is incomplete, downloading again") - with open(f"{path}/{filename}", "wb") as f: for chunk in rsp.iter_content(10240): f.write(chunk)