Skip to content

Commit

Permalink
[sankaku] support post URLs with alphanumeric IDs (#5073)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 18, 2024
1 parent ea553a1 commit a416d4c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gallery_dl/extractor/sankaku.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class SankakuPostExtractor(SankakuExtractor):
"""Extractor for single posts from sankaku.app"""
subcategory = "post"
archive_fmt = "{id}"
pattern = BASE_PATTERN + r"/posts?(?:/show)?/([0-9a-f]+)"
pattern = BASE_PATTERN + r"/posts?(?:/show)?/(\w+)"
example = "https://sankaku.app/post/show/12345"

def __init__(self, match):
Expand Down
35 changes: 28 additions & 7 deletions test/results/sankaku.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,46 @@
},

{
"#url" : "https://sankaku.app/post/show/360451",
"#url" : "https://sankaku.app/posts/y0abGlDOr2o",
"#category": ("booru", "sankaku", "post"),
"#class" : sankaku.SankakuPostExtractor,
"#options" : {"tags": True},
"#sha1_content": "5e255713cbf0a8e0801dc423563c34d896bb9229",

"tags_artist" : ["bonocho"],
"tags_studio" : ["dc_comics"],
"tags_medium" : list,
"tags_copyright": list,
"tags_character": list,
"tags_general" : list,
"tags_artist": [
"bonocho",
],
"tags_character": [
"batman",
"letty_whiterock",
"bruce_wayne",
"the_joker",
"heath_ledger",
],
"tags_copyright": [
"batman_(series)",
"the_dark_knight",
],
"tags_studio": [
"dc_comics",
],
"tags_general": list,
},

{
"#url" : "https://sankaku.app/post/show/360451",
"#comment" : "legacy post URL",
"#category": ("booru", "sankaku", "post"),
"#class" : sankaku.SankakuPostExtractor,
"#pattern" : r"https://s\.sankakucomplex\.com/data/ac/8e/ac8e3b92ea328ce9cf7211e69c905bf9\.jpg\?e=.+",
},

{
"#url" : "https://sankaku.app/post/show/21418978",
"#comment" : "'contentious_content'",
"#category": ("booru", "sankaku", "post"),
"#class" : sankaku.SankakuPostExtractor,
"#auth" : True,
"#pattern" : r"https://s\.sankakucomplex\.com/data/13/3c/133cda3bfde249c504284493903fb985\.jpg",
},

Expand Down

0 comments on commit a416d4c

Please sign in to comment.