[sankaku] support '/posts/' tag search URLs (#4740)

This commit is contained in:
Mike Fährmann
2023-10-29 13:48:42 +01:00
parent fd36eafe32
commit c9a2be36d4
2 changed files with 15 additions and 1 deletions

View File

@@ -87,7 +87,7 @@ class SankakuTagExtractor(SankakuExtractor):
subcategory = "tag"
directory_fmt = ("{category}", "{search_tags}")
archive_fmt = "t_{search_tags}_{id}"
pattern = BASE_PATTERN + r"/?\?([^#]*)"
pattern = BASE_PATTERN + r"(?:/posts)?/?\?([^#]*)"
example = "https://sankaku.app/?tags=TAG"
def __init__(self, match):

View File

@@ -53,6 +53,20 @@ __tests__ = (
"#class" : sankaku.SankakuTagExtractor,
},
{
"#url" : "https://chan.sankakucomplex.com/posts?tags=TAG",
"#comment" : "'/posts' in tag search URL (#4740)",
"#category": ("booru", "sankaku", "tag"),
"#class" : sankaku.SankakuTagExtractor,
},
{
"#url" : "https://chan.sankakucomplex.com/ja/posts/?tags=あえいおう",
"#comment" : "'/posts' in tag search URL (#4740)",
"#category": ("booru", "sankaku", "tag"),
"#class" : sankaku.SankakuTagExtractor,
},
{
"#url" : "https://chan.sankakucomplex.com/?tags=bonocho+a+b+c+d",
"#comment" : "error on five or more tags",