replace 'request(…).json()' with 'request_json(…)'

This commit is contained in:
Mike Fährmann
2025-06-29 17:17:09 +02:00
parent 9dbe33b6de
commit f2a72d8d1e
71 changed files with 157 additions and 161 deletions

View File

@@ -20,7 +20,7 @@ class ItchioGameExtractor(Extractor):
directory_fmt = ("{category}", "{user[name]}")
filename_fmt = "{game[title]} ({id}).{extension}"
archive_fmt = "{id}"
pattern = r"(?:https?://)?(\w+).itch\.io/([\w-]+)"
pattern = r"(?:https?://)?(\w+)\.itch\.io/([\w-]+)"
example = "https://USER.itch.io/GAME"
def __init__(self, match):
@@ -47,8 +47,8 @@ class ItchioGameExtractor(Extractor):
for upload_id in text.extract_iter(page, 'data-upload_id="', '"'):
file_url = f"{game_url}/file/{upload_id}"
info = self.request(file_url, method="POST", params=params,
headers=headers, data=data).json()
info = self.request_json(file_url, method="POST", params=params,
headers=headers, data=data)
game = info["lightbox"]["game"]
user = info["lightbox"]["user"]