From 6ef143ea3156cab8b148b3506c510920f14df2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 7 Feb 2024 14:57:13 +0100 Subject: [PATCH] [idolcomplex] support alphanumeric post IDs (#5171) --- gallery_dl/extractor/idolcomplex.py | 4 ++-- test/results/idolcomplex.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gallery_dl/extractor/idolcomplex.py b/gallery_dl/extractor/idolcomplex.py index f70a948c..12164124 100644 --- a/gallery_dl/extractor/idolcomplex.py +++ b/gallery_dl/extractor/idolcomplex.py @@ -35,7 +35,7 @@ class IdolcomplexExtractor(SankakuExtractor): def _init(self): self.find_pids = re.compile( - r" href=[\"#]/\w\w/posts/([0-9a-f]+)" + r" href=[\"#]/\w\w/posts/(\w+)" ).findall self.find_tags = re.compile( r'tag-type-([^"]+)">\s*]*?href="/[^?]*\?tags=([^"]+)' @@ -258,7 +258,7 @@ class IdolcomplexPostExtractor(IdolcomplexExtractor): """Extractor for single images from idol.sankakucomplex.com""" subcategory = "post" archive_fmt = "{id}" - pattern = BASE_PATTERN + r"/posts?/(?:show/)?([0-9a-f]+)" + pattern = BASE_PATTERN + r"/posts?/(?:show/)?(\w+)" example = "https://idol.sankakucomplex.com/posts/0123456789abcdef" def __init__(self, match): diff --git a/test/results/idolcomplex.py b/test/results/idolcomplex.py index 0152ee88..eab0edbf 100644 --- a/test/results/idolcomplex.py +++ b/test/results/idolcomplex.py @@ -61,7 +61,7 @@ __tests__ = ( }, { - "#url" : "https://idol.sankakucomplex.com/en/posts/509eccbba54a43cea6b275a65b93c51d", + "#url" : "https://idol.sankakucomplex.com/en/posts/vkr36qdOaZ4", "#category": ("booru", "idolcomplex", "post"), "#class" : idolcomplex.IdolcomplexPostExtractor, "#sha1_content": "694ec2491240787d75bf5d0c75d0082b53a85afd", @@ -86,6 +86,12 @@ __tests__ = ( "width" : 1024, }, +{ + "#url" : "https://idol.sankakucomplex.com/en/posts/509eccbba54a43cea6b275a65b93c51d", + "#category": ("booru", "idolcomplex", "post"), + "#class" : idolcomplex.IdolcomplexPostExtractor, +}, + { "#url" : "https://idol.sankakucomplex.com/en/posts/show/509eccbba54a43cea6b275a65b93c51d", "#category": ("booru", "idolcomplex", "post"),