[imhentai] avoid unnecessary HTTP request

no need to fetch a gallery's '/view/' page when the main page contains
all the same data as well
This commit is contained in:
Mike Fährmann
2025-02-16 15:04:24 +01:00
parent 800cf5beb5
commit b4eae65965

View File

@@ -79,9 +79,7 @@ class ImhentaiGalleryExtractor(ImhentaiExtractor, GalleryExtractor):
results.append(tag)
return results
def images(self, _):
url = "{}/view/{}/1/".format(self.root, self.gallery_id)
page = self.request(url).text
def images(self, page):
data = util.json_loads(text.extr(page, "$.parseJSON('", "'"))
base = text.extr(page, 'data-src="', '"').rpartition("/")[0] + "/"
exts = {"j": "jpg", "p": "png", "g": "gif", "w": "webp", "a": "avif"}