1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[koharu] cleanup

- update BASE_PATTERN formatting
- fix groups indices
- add tests for new domains
- update docs/supportedsites
This commit is contained in:
Mike Fährmann 2024-11-15 22:35:11 +01:00
parent a09d9edaa6
commit e5c2882320
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
4 changed files with 37 additions and 15 deletions

View File

@ -511,12 +511,6 @@ Consider all listed sites to potentially be NSFW.
<td>Soundtracks</td>
<td></td>
</tr>
<tr>
<td>Koharu</td>
<td>https://koharu.to/</td>
<td>Favorites, Galleries, Search Results</td>
<td></td>
</tr>
<tr>
<td>Komikcast</td>
<td>https://komikcast.cz/</td>
@ -829,6 +823,12 @@ Consider all listed sites to potentially be NSFW.
<td>Articles, Tag Searches</td>
<td></td>
</tr>
<tr>
<td>SchaleNetwork</td>
<td>https://niyaniya.moe/</td>
<td>Favorites, Galleries, Search Results</td>
<td></td>
</tr>
<tr>
<td>Scrolller</td>
<td>https://scrolller.com/</td>

View File

@ -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)

View File

@ -84,6 +84,7 @@ CATEGORY_MAP = {
"jpgfish" : "JPG Fish",
"kabeuchi" : "かべうち",
"kemonoparty" : "Kemono",
"koharu" : "SchaleNetwork",
"livedoor" : "livedoor Blog",
"ohpolly" : "Oh Polly",
"omgmiamiswimwear": "Omg Miami Swimwear",

View File

@ -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,
},
{