mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 12:12:34 +01:00
[danbooru] add single image/post extractor
This commit is contained in:
parent
ee1ba22d05
commit
205ef3ca02
@ -60,3 +60,21 @@ class DanbooruPoolExtractor(JSONBooruExtractor):
|
|||||||
"category": self.info["category"],
|
"category": self.info["category"],
|
||||||
"pool": self.pool,
|
"pool": self.pool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class DanbooruPostExtractor(JSONBooruExtractor):
|
||||||
|
"""Extract single images"""
|
||||||
|
|
||||||
|
info = {
|
||||||
|
"category": "danbooru",
|
||||||
|
"directory": ["{category}"],
|
||||||
|
"filename": "{category}_{id}_{md5}.{extension}",
|
||||||
|
}
|
||||||
|
pattern = [
|
||||||
|
r"(?:https?://)?(?:www\.)?danbooru.donmai.us/posts/(\d+)",
|
||||||
|
]
|
||||||
|
|
||||||
|
def __init__(self, match):
|
||||||
|
JSONBooruExtractor.__init__(self)
|
||||||
|
self.api_url = "https://danbooru.donmai.us/posts.json"
|
||||||
|
self.post = match.group(1)
|
||||||
|
self.params = {"tags": "id:" + self.post}
|
||||||
|
Loading…
Reference in New Issue
Block a user