summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/itchio.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-07-31 01:22:01 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-07-31 01:22:01 -0400
commita6e995c093de8aae2e91a0787281bb34c0b871eb (patch)
tree2d79821b05300d34d8871eb6c9662b359a2de85d /gallery_dl/extractor/itchio.py
parent7672a750cb74bf31e21d76aad2776367fd476155 (diff)
New upstream version 1.30.2.upstream/1.30.2
Diffstat (limited to 'gallery_dl/extractor/itchio.py')
-rw-r--r--gallery_dl/extractor/itchio.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gallery_dl/extractor/itchio.py b/gallery_dl/extractor/itchio.py
index 799dd66..6312e58 100644
--- a/gallery_dl/extractor/itchio.py
+++ b/gallery_dl/extractor/itchio.py
@@ -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):
@@ -28,7 +28,7 @@ class ItchioGameExtractor(Extractor):
Extractor.__init__(self, match)
def items(self):
- game_url = "https://{}.itch.io/{}".format(self.user, self.slug)
+ game_url = f"https://{self.user}.itch.io/{self.slug}"
page = self.request(game_url).text
params = {
@@ -39,16 +39,16 @@ class ItchioGameExtractor(Extractor):
headers = {
"Referer": game_url,
"X-Requested-With": "XMLHttpRequest",
- "Origin": "https://{}.itch.io".format(self.user),
+ "Origin": f"https://{self.user}.itch.io",
}
data = {
"csrf_token": text.unquote(self.cookies["itchio_token"]),
}
for upload_id in text.extract_iter(page, 'data-upload_id="', '"'):
- file_url = "{}/file/{}".format(game_url, upload_id)
- info = self.request(file_url, method="POST", params=params,
- headers=headers, data=data).json()
+ file_url = f"{game_url}/file/{upload_id}"
+ info = self.request_json(file_url, method="POST", params=params,
+ headers=headers, data=data)
game = info["lightbox"]["game"]
user = info["lightbox"]["user"]