diff options
| author | 2020-04-14 18:18:40 -0400 | |
|---|---|---|
| committer | 2020-04-14 18:18:40 -0400 | |
| commit | cf188f30e1c27bdb900fa2623a9ff91b944633b2 (patch) | |
| tree | 94803cd79aa8aaefd09d9bbc7b9c8029b415c885 /gallery_dl/extractor/hiperdex.py | |
| parent | e4887ae6b00c50fbbde531cc274c77b076bd821d (diff) | |
New upstream version 1.13.4upstream/1.13.4
Diffstat (limited to 'gallery_dl/extractor/hiperdex.py')
| -rw-r--r-- | gallery_dl/extractor/hiperdex.py | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/gallery_dl/extractor/hiperdex.py b/gallery_dl/extractor/hiperdex.py index e0b0f50..85cfe49 100644 --- a/gallery_dl/extractor/hiperdex.py +++ b/gallery_dl/extractor/hiperdex.py @@ -64,7 +64,9 @@ class HiperdexChapterExtractor(HiperdexBase, ChapterExtractor): pattern = (r"(?:https?://)?(?:www\.)?hiperdex\.com" r"(/manga/([^/?&#]+)/([^/?&#]+))") test = ("https://hiperdex.com/manga/domestic-na-kanojo/154-5/", { - "url": "111bc3ee14ce91d78c275770ef63b56c9ac15d8d", + "pattern": r"https://hiperdex.com/wp-content/uploads" + r"/WP-manga/data/manga_\w+/[0-9a-f]{32}/\d+\.webp", + "count": 9, "keyword": { "artist" : "Sasuga Kei", "author" : "Sasuga Kei", @@ -89,7 +91,8 @@ class HiperdexChapterExtractor(HiperdexBase, ChapterExtractor): def images(self, page): return [ (url.strip(), None) - for url in re.findall(r'id="image-\d+"\s+src="([^"]+)', page) + for url in re.findall( + r'id="image-\d+"\s+(?:data-)?src="([^"]+)', page) ] @@ -122,16 +125,44 @@ class HiperdexMangaExtractor(HiperdexBase, MangaExtractor): def chapters(self, page): self.manga_data(self.manga, page) results = [] - last = None - - page = text.extract(page, 'class="page-content-listing', '</ul>')[0] - for match in HiperdexChapterExtractor.pattern.finditer(page): - path = match.group(1) - if last != path: - last = path - results.append(( - self.root + path, - self.chapter_data(path.rpartition("/")[2]), - )) + shortlink = text.extract(page, "rel='shortlink' href='", "'")[0] + data = { + "action": "manga_get_chapters", + "manga" : shortlink.rpartition("=")[2], + } + url = self.root + "/wp-admin/admin-ajax.php" + page = self.request(url, method="POST", data=data).text + + for url in text.extract_iter(page, 'href="', '"', 320): + chapter = url.rpartition("/")[2] + results.append((url, self.chapter_data(chapter))) + + return results + + +class HiperdexArtistExtractor(HiperdexBase, MangaExtractor): + """Extractor for an artists's manga on hiperdex.com""" + subcategory = "artist" + categorytransfer = False + chapterclass = HiperdexMangaExtractor + reverse = False + pattern = (r"(?:https?://)?(?:www\.)?hiperdex\.com" + r"(/manga-a(?:rtist|uthor)/([^/?&#]+))") + test = ( + ("https://hiperdex.com/manga-artist/beck-ho-an/"), + ("https://hiperdex.com/manga-author/viagra/", { + "pattern": HiperdexMangaExtractor.pattern, + "count": ">= 6", + }), + ) + + def __init__(self, match): + MangaExtractor.__init__(self, match, self.root + match.group(1) + "/") + + def chapters(self, page): + results = [] + for info in text.extract_iter(page, 'id="manga-item-', '<img'): + url = text.extract(info, 'href="', '"')[0] + results.append((url, {})) return results |
