aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/simplyhentai.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/simplyhentai.py')
-rw-r--r--gallery_dl/extractor/simplyhentai.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/gallery_dl/extractor/simplyhentai.py b/gallery_dl/extractor/simplyhentai.py
index 6f72291..d6541b2 100644
--- a/gallery_dl/extractor/simplyhentai.py
+++ b/gallery_dl/extractor/simplyhentai.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2018-2023 Mike Fährmann
+# Copyright 2018-2025 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -29,7 +29,7 @@ class SimplyhentaiGalleryExtractor(GalleryExtractor):
GalleryExtractor.__init__(self, match, url)
def _init(self):
- self.session.headers["Referer"] = self.gallery_url
+ self.session.headers["Referer"] = self.page_url
def metadata(self, page):
extr = text.extract_from(page)
@@ -55,9 +55,9 @@ class SimplyhentaiGalleryExtractor(GalleryExtractor):
return data
def images(self, _):
- url = self.gallery_url + "/all-pages"
+ url = self.page_url + "/all-pages"
headers = {"Accept": "application/json"}
- images = self.request(url, headers=headers).json()
+ images = self.request_json(url, headers=headers)
return [
(
urls["full"].replace("/giant_thumb_", "/"),
@@ -80,8 +80,8 @@ class SimplyhentaiImageExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
- self.page_url = "https://old." + match.group(1)
- self.type = match.group(2)
+ self.page_url = "https://old." + match[1]
+ self.type = match[2]
def items(self):
extr = text.extract_from(self.request(self.page_url).text)
@@ -90,8 +90,7 @@ class SimplyhentaiImageExtractor(Extractor):
url = extr('"image":"' , '&')
url = extr(""content":"", "&") or url
- tags = text.extr(descr, " tagged with ", " online for free ")
- if tags:
+ if tags := text.extr(descr, " tagged with ", " online for free "):
tags = tags.split(", ")
tags[-1] = tags[-1].partition(" ")[2]
else:
@@ -123,7 +122,7 @@ class SimplyhentaiVideoExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
- self.page_url = "https://" + match.group(1)
+ self.page_url = "https://" + match[1]
def items(self):
page = self.request(self.page_url).text