From 8b76149521638404100dd20511ba08e67f1c1f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 9 Sep 2022 12:10:55 +0200 Subject: [PATCH] [exhentai] improve 509.gif detection (#2901) --- gallery_dl/extractor/exhentai.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index 27206913..a2c06776 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -328,8 +328,13 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): data["image_token"] = self.key["start"] = extr('var startkey="', '";') self.key["show"] = extr('var showkey="', '";') - if iurl.endswith("g/509.gif"): + # full 509.gif URLs + # - https://exhentai.org/img/509.gif + # - https://ehgt.org/g/509.gif + if iurl.endswith(("hentai.org/img/509.gif", + "ehgt.org/g/509.gif")): self._report_limits(data) + return url, text.nameext_from_url(iurl, data) def images_from_api(self): @@ -365,7 +370,8 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): data["num"] = request["page"] data["image_token"] = imgkey - if imgurl.endswith("g/509.gif"): + if imgurl.endswith(("hentai.org/img/509.gif", + "ehgt.org/g/509.gif")): self._report_limits(data) yield url, text.nameext_from_url(imgurl, data)