aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/itchio.py
diff options
context:
space:
mode:
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"]