From 26bc2d55f465b6b416f2c0401d10d24508496332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 17 Mar 2024 14:04:21 +0100 Subject: [PATCH] [hiperdex] update URL patterns & fix 'manga' metadata (#5340) --- gallery_dl/extractor/hiperdex.py | 12 ++++++------ test/results/hiperdex.py | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gallery_dl/extractor/hiperdex.py b/gallery_dl/extractor/hiperdex.py index 20491b56..aadce6ca 100644 --- a/gallery_dl/extractor/hiperdex.py +++ b/gallery_dl/extractor/hiperdex.py @@ -25,7 +25,7 @@ class HiperdexBase(): @memcache(keyarg=1) def manga_data(self, manga, page=None): if not page: - url = "{}/manga/{}/".format(self.root, manga) + url = "{}/mangas/{}/".format(self.root, manga) page = self.request(url).text extr = text.extract_from(page) @@ -33,7 +33,7 @@ class HiperdexBase(): "url" : text.unescape(extr( 'property="og:url" content="', '"')), "manga" : text.unescape(extr( - '"headline": "', '"')), + ' property="name" title="', '"')), "score" : text.parse_float(extr( 'id="averagerate">', '<')), "author" : text.remove_html(extr( @@ -68,8 +68,8 @@ class HiperdexBase(): class HiperdexChapterExtractor(HiperdexBase, ChapterExtractor): """Extractor for manga chapters from hiperdex.com""" - pattern = BASE_PATTERN + r"(/manga/([^/?#]+)/([^/?#]+))" - example = "https://hiperdex.com/manga/MANGA/CHAPTER/" + pattern = BASE_PATTERN + r"(/mangas?/([^/?#]+)/([^/?#]+))" + example = "https://hiperdex.com/mangas/MANGA/CHAPTER/" def __init__(self, match): root, path, self.manga, self.chapter = match.groups() @@ -90,8 +90,8 @@ class HiperdexChapterExtractor(HiperdexBase, ChapterExtractor): class HiperdexMangaExtractor(HiperdexBase, MangaExtractor): """Extractor for manga from hiperdex.com""" chapterclass = HiperdexChapterExtractor - pattern = BASE_PATTERN + r"(/manga/([^/?#]+))/?$" - example = "https://hiperdex.com/manga/MANGA/" + pattern = BASE_PATTERN + r"(/mangas?/([^/?#]+))/?$" + example = "https://hiperdex.com/mangas/MANGA/" def __init__(self, match): root, path, self.manga = match.groups() diff --git a/test/results/hiperdex.py b/test/results/hiperdex.py index 33948f22..bb421142 100644 --- a/test/results/hiperdex.py +++ b/test/results/hiperdex.py @@ -9,7 +9,7 @@ from gallery_dl.extractor import hiperdex __tests__ = ( { - "#url" : "https://hiperdex.com/manga/domestic-na-kanojo/154-5/", + "#url" : "https://hiperdex.com/mangas/domestic-na-kanojo/154-5/", "#category": ("", "hiperdex", "chapter"), "#class" : hiperdex.HiperdexChapterExtractor, "#pattern" : r"https://(1st)?hiperdex\d?.(com|net|info)/wp-content/uploads/WP-manga/data/manga_\w+/[0-9a-f]{32}/\d+\.webp", @@ -27,6 +27,12 @@ __tests__ = ( "type" : "Manga", }, +{ + "#url" : "https://hiperdex.com/manga/domestic-na-kanojo/154-5/", + "#category": ("", "hiperdex", "chapter"), + "#class" : hiperdex.HiperdexChapterExtractor, +}, + { "#url" : "https://1sthiperdex.com/manga/domestic-na-kanojo/154-5/", "#category": ("", "hiperdex", "chapter"),