Fix broken --download-game parameter

In commit c652516eec a check was added to
determine if a game was not purchased via the `uploads/` endpoint.
Unfortunately that endpoint replaced the call to the game data endpoint
that we need to download the game. This adds the game data endpoint call
back in.
This commit is contained in:
Jeremie J. Jarosh 2023-04-15 13:52:36 -05:00
parent 7cec2f24a2
commit 16db30f496

View file

@ -49,11 +49,16 @@ class Library:
j = json.loads(rsp.text)
game_id = j["id"]
gsp = requests.get(
f"https://api.itch.io/games/{game_id}/uploads",
f"https://api.itch.io/games/{game_id}",
headers={"Authorization": self.login},
)
k = gsp.json()
if k != {"uploads": {}}:
usp = requests.get(
f"https://api.itch.io/games/{game_id}/uploads",
headers={"Authorization": self.login},
)
l = usp.json()
if l != {"uploads": {}}:
self.games.append(Game(k))
return
print(f"{title} is a purchased game.")