From 85d705901ca04c1d572b014994cc4ba80206fd8e Mon Sep 17 00:00:00 2001 From: 64Core <64core@pm.me> Date: Wed, 29 Mar 2023 22:42:10 -0500 Subject: [PATCH] PR #77 Linting Fixes --- itchiodl/game.py | 11 +++++------ itchiodl/utils.py | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/itchiodl/game.py b/itchiodl/game.py index 276f071..26d5e5e 100644 --- a/itchiodl/game.py +++ b/itchiodl/game.py @@ -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} diff --git a/itchiodl/utils.py b/itchiodl/utils.py index 1a20de8..b03e0ab 100644 --- a/itchiodl/utils.py +++ b/itchiodl/utils.py @@ -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: