mirror of
https://github.com/Emersont1/itchio.git
synced 2026-03-11 08:54:39 +00:00
Fixed Handling of Single Game Downloads that are not part of your library
This commit is contained in:
parent
c4052c0f1d
commit
a123b4dd16
3 changed files with 8 additions and 5 deletions
|
|
@ -87,10 +87,12 @@ def main():
|
|||
lib.games = [game]
|
||||
break
|
||||
if len(lib) > 1:
|
||||
print("Game Is Not In Library, terminating")
|
||||
return -1
|
||||
# matches = re.match(r"https://(.+)\.itch\.io/(.+)", args.download_game)
|
||||
# lib.load_game(matches.group(1), matches.group(2))
|
||||
print("Game Is Not In Library, Checking for Free Downloads")
|
||||
lib.games = []
|
||||
matches = re.match(r"https://(.+)\.itch\.io/(.+)", args.download_game)
|
||||
lib.load_game(matches.group(1), matches.group(2))
|
||||
|
||||
|
||||
else:
|
||||
lib.load_owned_games()
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,6 @@ class Game:
|
|||
+ f"download?api_key={token}&download_key_id={self.id}&uuid={j['uuid']}"
|
||||
)
|
||||
else:
|
||||
print("!! NO DOWNLOAD KEY !!")
|
||||
url = (
|
||||
f"https://api.itch.io/uploads/{d['id']}/"
|
||||
+ f"download?api_key={token}&uuid={j['uuid']}"
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ class Library:
|
|||
)
|
||||
k = json.loads(gsp.text)
|
||||
self.games.append(Game(k))
|
||||
self.games[-1].id = False
|
||||
self.games[-1].game_id = j["id"]
|
||||
|
||||
def load_games(self, publisher):
|
||||
"""Load all games by publisher"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue