From d67c857ac2b6e02b019c0af6f3bf4f9cd40b9ff4 Mon Sep 17 00:00:00 2001 From: 64Core Date: Wed, 8 Jun 2022 22:52:24 -0500 Subject: [PATCH] Second pass at solving the largest sources of exceptions --- itchiodl/game.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/itchiodl/game.py b/itchiodl/game.py index cfc0e44..5cdc967 100644 --- a/itchiodl/game.py +++ b/itchiodl/game.py @@ -80,9 +80,11 @@ class Game: headers={"Authorization": token}, ) j = r.json() + if j.get("uploads") is None: + j.update({"uploads": []}) for d in j.get("uploads"): if d.get("size") is None: - d.update("size", 0) + d.update({"size": 0}) if not self.skipping_large_entries: self.downloads.append(d) elif self.skipping_above_size_B > d.get("size"): @@ -225,7 +227,9 @@ class Game: # Verify if self.verify: - if itchiodl.utils.md5sum(f"{path}/{file}") != d["md5_hash"]: + if itchiodl.utils.md5sum(f"{path}/{file}") != d.get("md5_hash"): + if d.get("md5_hash") is None: + return print(f"Failed to verify {file}") return # Create checksum file