mirror of
https://github.com/Emersont1/itchio.git
synced 2026-03-11 08:54:39 +00:00
Was Calling the wrong login function
This commit is contained in:
parent
e078d23ceb
commit
9825ee7f34
3 changed files with 8 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "itchio"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
description = "Python Scripts for downloading / archiving your itchio library"
|
||||
authors = ["Peter Taylor <me@et1.uk>"]
|
||||
license = "MIT"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ l = ""
|
|||
if not args.api_key:
|
||||
user = input("Username: ")
|
||||
password = getpass("Password: ")
|
||||
l = itchio.LoginWeb(user, password)
|
||||
l = itchio.LoginAPI(user, password)
|
||||
else:
|
||||
l = args.api_key
|
||||
|
||||
|
|
|
|||
|
|
@ -48,17 +48,17 @@ class Game:
|
|||
}, f)
|
||||
|
||||
for d in self.downloads:
|
||||
# Get UUID
|
||||
r = requests.post(f"https://api.itch.io/games/{self.game_id}/download-sessions", headers={"Authorization": token})
|
||||
j = r.json()
|
||||
print(j)
|
||||
|
||||
# Download
|
||||
file = d['filename'] or d['display_name'] or d['id']
|
||||
outfile = f"{self.publisher_slug}/{self.game_slug}/{file}"
|
||||
if os.path.exists(outfile):
|
||||
print(f"Skipping {outfile}")
|
||||
continue
|
||||
|
||||
# Get UUID
|
||||
r = requests.post(f"https://api.itch.io/games/{self.game_id}/download-sessions", headers={"Authorization": token})
|
||||
j = r.json()
|
||||
|
||||
# Download
|
||||
|
||||
url = f"https://api.itch.io/uploads/{d['id']}/download?api_key={token}&download_key_id={self.id}&uuid={j['uuid']}"
|
||||
itchio.utils.download_url(url, outfile, self.name +" - "+file)
|
||||
|
|
|
|||
Loading…
Reference in a new issue