mirror of
https://github.com/Emersont1/itchio.git
synced 2026-03-11 08:54:39 +00:00
Fix None Download (#66)
Fixes: #57 #59 #63 This is a really sub-par fix to the problem for downloading a singular game that you own + Owned games need a download key + I can only find this via owned-keys + It requires searching through (up to) all of your owned keys
This commit is contained in:
parent
faf9428e23
commit
c652516eec
1 changed files with 22 additions and 3 deletions
|
|
@ -48,11 +48,30 @@ class Library:
|
|||
j = json.loads(rsp.text)
|
||||
game_id = j["id"]
|
||||
gsp = requests.get(
|
||||
f"https://api.itch.io/games/{game_id}",
|
||||
f"https://api.itch.io/games/{game_id}/uploads",
|
||||
headers={"Authorization": self.login},
|
||||
)
|
||||
k = json.loads(gsp.text)
|
||||
self.games.append(Game(k))
|
||||
k = gsp.json()
|
||||
if k != {"uploads": {}}:
|
||||
self.games.append(Game(k))
|
||||
return
|
||||
print(f"{title} is a purchased game.")
|
||||
i = 1
|
||||
while self.games == []:
|
||||
j = self.load_game_page(i)
|
||||
|
||||
self.games = [
|
||||
x
|
||||
for x in self.games
|
||||
if x.link == f"https://{publisher}.itch.io/{title}"
|
||||
]
|
||||
|
||||
if j == 0:
|
||||
break
|
||||
i += 1
|
||||
|
||||
if self.games == []:
|
||||
print(f"Cannot find {title} in owned keys, you may not own it.")
|
||||
|
||||
def load_games(self, publisher):
|
||||
"""Load all games by publisher"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue