diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 04a6b64a..4f06028f 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -511,12 +511,6 @@ Consider all listed sites to potentially be NSFW. Soundtracks - - Koharu - https://koharu.to/ - Favorites, Galleries, Search Results - - Komikcast https://komikcast.cz/ @@ -829,6 +823,12 @@ Consider all listed sites to potentially be NSFW. Articles, Tag Searches + + SchaleNetwork + https://niyaniya.moe/ + Favorites, Galleries, Search Results + + Scrolller https://scrolller.com/ diff --git a/gallery_dl/extractor/koharu.py b/gallery_dl/extractor/koharu.py index 91792fd4..7c04dcb1 100644 --- a/gallery_dl/extractor/koharu.py +++ b/gallery_dl/extractor/koharu.py @@ -6,13 +6,19 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -"""Extractors for https://koharu.to/""" +"""Extractors for https://niyaniya.moe/""" from .common import GalleryExtractor, Extractor, Message from .. import text, exception from ..cache import cache -BASE_PATTERN = r"(?i)(?:https?://)?((?:anchira|seia)\.to|(?:niyaniya|shupogaki)\.moe|hoshino\.one)" +BASE_PATTERN = ( + r"(?i)(?:https?://)?(" + r"(?:niyaniya|shupogaki)\.moe|" + r"(?:koharu|anchira|seia)\.to|" + r"(?:hoshino)\.one" + r")" +) class KoharuExtractor(Extractor): @@ -179,11 +185,11 @@ class KoharuGalleryExtractor(KoharuExtractor, GalleryExtractor): break except KeyError: self.log.debug("%s: Format %s is not available", - self.groups[0], fmtid) + self.groups[1], fmtid) else: raise exception.NotFoundError("format") - self.log.debug("%s: Selected format %s", self.groups[0], fmtid) + self.log.debug("%s: Selected format %s", self.groups[1], fmtid) fmt["w"] = fmtid return fmt @@ -195,7 +201,7 @@ class KoharuSearchExtractor(KoharuExtractor): example = "https://niyaniya.moe/?s=QUERY" def items(self): - params = text.parse_query(self.groups[0]) + params = text.parse_query(self.groups[1]) params["page"] = text.parse_int(params.get("page"), 1) return self._pagination("/books", params) @@ -209,7 +215,7 @@ class KoharuFavoriteExtractor(KoharuExtractor): def items(self): self.login() - params = text.parse_query(self.groups[0]) + params = text.parse_query(self.groups[1]) params["page"] = text.parse_int(params.get("page"), 1) return self._pagination("/favorites", params) diff --git a/scripts/supportedsites.py b/scripts/supportedsites.py index 2d727170..4ba5a763 100755 --- a/scripts/supportedsites.py +++ b/scripts/supportedsites.py @@ -84,6 +84,7 @@ CATEGORY_MAP = { "jpgfish" : "JPG Fish", "kabeuchi" : "かべうち", "kemonoparty" : "Kemono", + "koharu" : "SchaleNetwork", "livedoor" : "livedoor Blog", "ohpolly" : "Oh Polly", "omgmiamiswimwear": "Omg Miami Swimwear", diff --git a/test/results/koharu.py b/test/results/koharu.py index d2597342..8ba22146 100644 --- a/test/results/koharu.py +++ b/test/results/koharu.py @@ -66,9 +66,24 @@ __tests__ = ( }, { - "#url" : "https://anchira.to/g/14216/6c67076fdd45", - "#category": ("", "koharu", "gallery"), - "#class" : koharu.KoharuGalleryExtractor, + "#url" : "https://koharu.to/g/14216/6c67076fdd45", + "#class": koharu.KoharuGalleryExtractor, +}, +{ + "#url" : "https://anchira.to/g/14216/6c67076fdd45", + "#class": koharu.KoharuGalleryExtractor, +}, +{ + "#url" : "https://seia.to/g/14216/6c67076fdd45", + "#class": koharu.KoharuGalleryExtractor, +}, +{ + "#url" : "https://shupogaki.moe/g/14216/6c67076fdd45", + "#class": koharu.KoharuGalleryExtractor, +}, +{ + "#url" : "https://hoshino.one/g/14216/6c67076fdd45", + "#class": koharu.KoharuGalleryExtractor, }, {