mirror of
https://github.com/Emersont1/itchio.git
synced 2026-03-11 08:54:39 +00:00
escaped the wrong path
This commit is contained in:
parent
0bebcddcc4
commit
1a9cf0f338
2 changed files with 2 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue