[sankaku][idolcomplex] support URLs with locale code (#8667)

This commit is contained in:
Mike Fährmann
2025-12-09 08:23:40 +01:00
parent 7516537630
commit 1b4249ed37
4 changed files with 26 additions and 2 deletions

View File

@@ -11,7 +11,8 @@
from . import sankaku
BASE_PATTERN = (r"(?:https?://)?(?:www\.)?"
r"idol(?:\.sankaku)?complex\.com(?:/[a-z]{2})?")
r"idol(?:\.sankaku)?complex\.com"
r"(?:/[a-z]{2}(?:[-_][A-Z]{2})?)?")
class IdolcomplexBase():

View File

@@ -16,7 +16,7 @@ import collections
BASE_PATTERN = r"(?:https?://)?" \
r"(?:(?:chan|www|beta|black|white)\.sankakucomplex\.com|sankaku\.app)" \
r"(?:/[a-z]{2})?"
r"(?:/[a-z]{2}(?:[-_][A-Z]{2})?)?"
class SankakuExtractor(BooruExtractor):

View File

@@ -18,6 +18,13 @@ __tests__ = (
"#count" : 5,
},
{
"#url" : "https://www.idolcomplex.com/zh-CN/posts?tags=lyumos",
"#comment" : "locale code (ISO 639-1 + ISO 3166-1) (#8667)",
"#category": ("booru", "idolcomplex", "tag"),
"#class" : idolcomplex.IdolcomplexTagExtractor,
},
{
"#url" : "https://idolcomplex.com/posts?tags=lyumos",
"#category": ("booru", "idolcomplex", "tag"),

View File

@@ -49,12 +49,28 @@ __tests__ = (
{
"#url" : "https://sankaku.app/ja?tags=order%3Apopularity",
"#comment" : "ISO 639-1",
"#category": ("booru", "sankaku", "tag"),
"#class" : sankaku.SankakuTagExtractor,
},
{
"#url" : "https://sankaku.app/no/?tags=order%3Apopularity",
"#comment" : "ISO 639-1 with trailing '/'",
"#category": ("booru", "sankaku", "tag"),
"#class" : sankaku.SankakuTagExtractor,
},
{
"#url" : "https://sankaku.app/zh-CN/?tags=order%3Apopularity",
"#comment" : "locale code (ISO 639-1 + ISO 3166-1) (#8667)",
"#category": ("booru", "sankaku", "tag"),
"#class" : sankaku.SankakuTagExtractor,
},
{
"#url" : "https://sankaku.app/zh_CN/?tags=order%3Apopularity",
"#comment" : "locale code (ISO 639-1 + ISO 3166-1) (#8667)",
"#category": ("booru", "sankaku", "tag"),
"#class" : sankaku.SankakuTagExtractor,
},