From a37b7759bccdba8798a76afb0cb44535296cba25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 12 Dec 2023 20:02:28 +0100 Subject: [PATCH] [myhentaigallery] recognize '/g/' URLs (#4920) --- gallery_dl/extractor/myhentaigallery.py | 6 +++--- test/results/myhentaigallery.py | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/myhentaigallery.py b/gallery_dl/extractor/myhentaigallery.py index 33a22849..5e8179ec 100644 --- a/gallery_dl/extractor/myhentaigallery.py +++ b/gallery_dl/extractor/myhentaigallery.py @@ -16,12 +16,12 @@ class MyhentaigalleryGalleryExtractor(GalleryExtractor): root = "https://myhentaigallery.com" directory_fmt = ("{category}", "{gallery_id} {artist:?[/] /J, }{title}") pattern = (r"(?:https?://)?myhentaigallery\.com" - r"/gallery/(?:thumbnails|show)/(\d+)") - example = "https://myhentaigallery.com/gallery/thumbnails/12345" + r"/g(?:allery/(?:thumbnails|show))?/(\d+)") + example = "https://myhentaigallery.com/g/12345" def __init__(self, match): self.gallery_id = match.group(1) - url = "{}/gallery/thumbnails/{}".format(self.root, self.gallery_id) + url = "{}/g/{}".format(self.root, self.gallery_id) GalleryExtractor.__init__(self, match, url) def _init(self): diff --git a/test/results/myhentaigallery.py b/test/results/myhentaigallery.py index b7b5ac99..283d6d01 100644 --- a/test/results/myhentaigallery.py +++ b/test/results/myhentaigallery.py @@ -9,7 +9,7 @@ from gallery_dl.extractor import myhentaigallery __tests__ = ( { - "#url" : "https://myhentaigallery.com/gallery/thumbnails/16247", + "#url" : "https://myhentaigallery.com/g/16247", "#category": ("", "myhentaigallery", "gallery"), "#class" : myhentaigallery.MyhentaigalleryGalleryExtractor, "#pattern" : r"https://images\.myhentaicomics\.com/mhg/images/[^/]+/original/\d+\.jpg", @@ -23,6 +23,12 @@ __tests__ = ( "title" : "Attack Of The 50ft Woman 1", }, +{ + "#url" : "https://myhentaigallery.com/gallery/thumbnails/16247", + "#category": ("", "myhentaigallery", "gallery"), + "#class" : myhentaigallery.MyhentaigalleryGalleryExtractor, +}, + { "#url" : "https://myhentaigallery.com/gallery/show/16247/1", "#category": ("", "myhentaigallery", "gallery"),