escaped the wrong path

This commit is contained in:
Peter Taylor 2022-03-27 03:24:04 +01:00
parent 0bebcddcc4
commit 1a9cf0f338
2 changed files with 2 additions and 12 deletions

View file

@ -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

View file

@ -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)