[hiperdex] update domain (#3572)

pull/3581/head
Mike Fährmann 2 years ago
parent a050fe0d94
commit 58c008e30a
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -309,7 +309,7 @@ Consider all sites to be NSFW unless otherwise known.
</tr> </tr>
<tr> <tr>
<td>Hiperdex</td> <td>Hiperdex</td>
<td>https://hiperdex.com/</td> <td>https://1sthiperdex.com/</td>
<td>Artists, Chapters, Manga</td> <td>Artists, Chapters, Manga</td>
<td></td> <td></td>
</tr> </tr>

@ -1,25 +1,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2020-2021 Mike Fährmann # Copyright 2020-2023 Mike Fährmann
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as # it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation. # published by the Free Software Foundation.
"""Extractors for https://hiperdex.com/""" """Extractors for https://1sthiperdex.com/"""
from .common import ChapterExtractor, MangaExtractor from .common import ChapterExtractor, MangaExtractor
from .. import text from .. import text
from ..cache import memcache from ..cache import memcache
import re import re
BASE_PATTERN = r"((?:https?://)?(?:www\.)?hiperdex\d?\.(?:com|net|info))" BASE_PATTERN = (r"((?:https?://)?(?:www\.)?"
r"(?:1st)?hiperdex\d?\.(?:com|net|info))")
class HiperdexBase(): class HiperdexBase():
"""Base class for hiperdex extractors""" """Base class for hiperdex extractors"""
category = "hiperdex" category = "hiperdex"
root = "https://hiperdex.com" root = "https://1sthiperdex.com"
@memcache(keyarg=1) @memcache(keyarg=1)
def manga_data(self, manga, page=None): def manga_data(self, manga, page=None):
@ -52,6 +53,8 @@ class HiperdexBase():
} }
def chapter_data(self, chapter): def chapter_data(self, chapter):
if chapter.startswith("chapter-"):
chapter = chapter[8:]
chapter, _, minor = chapter.partition("-") chapter, _, minor = chapter.partition("-")
data = { data = {
"chapter" : text.parse_int(chapter), "chapter" : text.parse_int(chapter),
@ -62,12 +65,13 @@ class HiperdexBase():
class HiperdexChapterExtractor(HiperdexBase, ChapterExtractor): class HiperdexChapterExtractor(HiperdexBase, ChapterExtractor):
"""Extractor for manga chapters from hiperdex.com""" """Extractor for manga chapters from 1sthiperdex.com"""
pattern = BASE_PATTERN + r"(/manga/([^/?#]+)/([^/?#]+))" pattern = BASE_PATTERN + r"(/manga/([^/?#]+)/([^/?#]+))"
test = ( test = (
("https://hiperdex.com/manga/domestic-na-kanojo/154-5/", { ("https://1sthiperdex.com/manga/domestic-na-kanojo/154-5/", {
"pattern": r"https://hiperdex\d?.(com|net|info)/wp-content/uploads" "pattern": r"https://(1st)?hiperdex\d?.(com|net|info)"
r"/WP-manga/data/manga_\w+/[0-9a-f]{32}/\d+\.webp", r"/wp-content/uploads/WP-manga/data"
r"/manga_\w+/[0-9a-f]{32}/\d+\.webp",
"count": 9, "count": 9,
"keyword": { "keyword": {
"artist" : "Sasuga Kei", "artist" : "Sasuga Kei",
@ -82,6 +86,7 @@ class HiperdexChapterExtractor(HiperdexBase, ChapterExtractor):
"type" : "Manga", "type" : "Manga",
}, },
}), }),
("https://hiperdex.com/manga/domestic-na-kanojo/154-5/"),
("https://hiperdex2.com/manga/domestic-na-kanojo/154-5/"), ("https://hiperdex2.com/manga/domestic-na-kanojo/154-5/"),
("https://hiperdex.net/manga/domestic-na-kanojo/154-5/"), ("https://hiperdex.net/manga/domestic-na-kanojo/154-5/"),
("https://hiperdex.info/manga/domestic-na-kanojo/154-5/"), ("https://hiperdex.info/manga/domestic-na-kanojo/154-5/"),
@ -104,11 +109,11 @@ class HiperdexChapterExtractor(HiperdexBase, ChapterExtractor):
class HiperdexMangaExtractor(HiperdexBase, MangaExtractor): class HiperdexMangaExtractor(HiperdexBase, MangaExtractor):
"""Extractor for manga from hiperdex.com""" """Extractor for manga from 1sthiperdex.com"""
chapterclass = HiperdexChapterExtractor chapterclass = HiperdexChapterExtractor
pattern = BASE_PATTERN + r"(/manga/([^/?#]+))/?$" pattern = BASE_PATTERN + r"(/manga/([^/?#]+))/?$"
test = ( test = (
("https://hiperdex.com/manga/youre-not-that-special/", { ("https://1sthiperdex.com/manga/youre-not-that-special/", {
"count": 51, "count": 51,
"pattern": HiperdexChapterExtractor.pattern, "pattern": HiperdexChapterExtractor.pattern,
"keyword": { "keyword": {
@ -125,6 +130,7 @@ class HiperdexMangaExtractor(HiperdexBase, MangaExtractor):
"type" : "Manhwa", "type" : "Manhwa",
}, },
}), }),
("https://hiperdex.com/manga/youre-not-that-special/"),
("https://hiperdex2.com/manga/youre-not-that-special/"), ("https://hiperdex2.com/manga/youre-not-that-special/"),
("https://hiperdex.net/manga/youre-not-that-special/"), ("https://hiperdex.net/manga/youre-not-that-special/"),
("https://hiperdex.info/manga/youre-not-that-special/"), ("https://hiperdex.info/manga/youre-not-that-special/"),
@ -166,6 +172,7 @@ class HiperdexArtistExtractor(HiperdexBase, MangaExtractor):
reverse = False reverse = False
pattern = BASE_PATTERN + r"(/manga-a(?:rtist|uthor)/(?:[^/?#]+))" pattern = BASE_PATTERN + r"(/manga-a(?:rtist|uthor)/(?:[^/?#]+))"
test = ( test = (
("https://1sthiperdex.com/manga-artist/beck-ho-an/"),
("https://hiperdex.net/manga-artist/beck-ho-an/"), ("https://hiperdex.net/manga-artist/beck-ho-an/"),
("https://hiperdex2.com/manga-artist/beck-ho-an/"), ("https://hiperdex2.com/manga-artist/beck-ho-an/"),
("https://hiperdex.info/manga-artist/beck-ho-an/"), ("https://hiperdex.info/manga-artist/beck-ho-an/"),

Loading…
Cancel
Save