From 645b4627ef4e31b79219154c5db5356c26a16cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 24 Nov 2023 02:41:52 +0100 Subject: [PATCH] [sankaku] update URL patterns --- gallery_dl/extractor/sankaku.py | 4 ++-- test/results/sankaku.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/sankaku.py b/gallery_dl/extractor/sankaku.py index bebea2a2..89412584 100644 --- a/gallery_dl/extractor/sankaku.py +++ b/gallery_dl/extractor/sankaku.py @@ -117,7 +117,7 @@ class SankakuPoolExtractor(SankakuExtractor): subcategory = "pool" directory_fmt = ("{category}", "pool", "{pool[id]} {pool[name_en]}") archive_fmt = "p_{pool}_{id}" - pattern = BASE_PATTERN + r"/(?:books|pool/show)/(\d+)" + pattern = BASE_PATTERN + r"/(?:books|pools?/show)/(\d+)" example = "https://sankaku.app/books/12345" def __init__(self, match): @@ -143,7 +143,7 @@ class SankakuPostExtractor(SankakuExtractor): """Extractor for single posts from sankaku.app""" subcategory = "post" archive_fmt = "{id}" - pattern = BASE_PATTERN + r"/post(?:s|/show)/([0-9a-f]+)" + pattern = BASE_PATTERN + r"/posts?(?:/show)?/([0-9a-f]+)" example = "https://sankaku.app/post/show/12345" def __init__(self, match): diff --git a/test/results/sankaku.py b/test/results/sankaku.py index 37330f26..89396daa 100644 --- a/test/results/sankaku.py +++ b/test/results/sankaku.py @@ -111,6 +111,12 @@ __tests__ = ( "#class" : sankaku.SankakuPoolExtractor, }, +{ + "#url" : "https://chan.sankakucomplex.com/pools/show/90", + "#category": ("booru", "sankaku", "pool"), + "#class" : sankaku.SankakuPoolExtractor, +}, + { "#url" : "https://sankaku.app/post/show/360451", "#category": ("booru", "sankaku", "post"), @@ -173,6 +179,16 @@ __tests__ = ( "md5": "f8ba89043078f0e4be2d9c46550b840a", }, +{ + "#url" : "https://chan.sankakucomplex.com/en/posts/show/ac8e3b92ea328ce9cf7211e69c905bf9", + "#comment" : "/en/posts/show/HEX", + "#category": ("booru", "sankaku", "post"), + "#class" : sankaku.SankakuPostExtractor, + + "id" : 360451, + "md5": "ac8e3b92ea328ce9cf7211e69c905bf9", +}, + { "#url" : "https://chan.sankakucomplex.com/post/show/360451", "#category": ("booru", "sankaku", "post"),