[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:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user