mirror of
https://github.com/Emersont1/itchio.git
synced 2026-03-11 08:54:39 +00:00
PR #77 Linting Fixes
This commit is contained in:
parent
dbc42dd4b2
commit
85d705901c
2 changed files with 9 additions and 10 deletions
|
|
@ -109,10 +109,9 @@ class Game:
|
|||
print(f"Downloading {d['filename']}")
|
||||
|
||||
filename = utils.clean_path(d["filename"] or d["display_name"] or d["id"])
|
||||
pathname = self.destination_path
|
||||
filepath = Path(f"{pathname}/{filename}")
|
||||
hashpath = Path(f"{pathname}/{filename}.md5")
|
||||
oldpath = Path(f"{pathname}/old")
|
||||
filepath = Path(f"{self.destination_path}/{filename}")
|
||||
hashpath = Path(f"{self.destination_path}/{filename}.md5")
|
||||
oldpath = Path(f"{self.destination_path}/old")
|
||||
if filepath.exists():
|
||||
print(f"File Already Exists! {filename}")
|
||||
if hashpath.exists():
|
||||
|
|
@ -171,7 +170,7 @@ class Game:
|
|||
f.write(
|
||||
f""" Cannot download game/asset: {self.game_slug}
|
||||
Publisher Name: {self.publisher_slug}
|
||||
Path: {pathname}
|
||||
Path: {self.destination_path}
|
||||
File: {filename}
|
||||
Request URL: {url}
|
||||
This request failed due to a missing response header
|
||||
|
|
@ -187,7 +186,7 @@ class Game:
|
|||
f.write(
|
||||
f""" Cannot download game/asset: {self.game_slug}
|
||||
Publisher Name: {self.publisher_slug}
|
||||
Path: {pathname}
|
||||
Path: {self.destination_path}
|
||||
File: {filename}
|
||||
Request URL: {url}
|
||||
Request Response Code: {e.code}
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ def download(url, path, name, file):
|
|||
):
|
||||
raise NoDownloadError("Http response is not a download, skipping")
|
||||
|
||||
cd = rsp.headers.get("Content-Disposition")
|
||||
# cd = rsp.headers.get("Content-Disposition")
|
||||
|
||||
#filename_re = re.search(r'filename="(.+)"', cd)
|
||||
#if filename_re is None:
|
||||
# filename_re = re.search(r'filename="(.+)"', cd)
|
||||
# if filename_re is None:
|
||||
# filename = file
|
||||
#else:
|
||||
# else:
|
||||
# filename = filename_re.group(1)
|
||||
|
||||
with open(f"{path}/{file}", "wb") as f:
|
||||
|
|
|
|||
Loading…
Reference in a new issue