1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

[yandere] update to new format

This commit is contained in:
Mike Fährmann 2015-11-21 00:55:40 +01:00
parent 15dec86e6a
commit 70a6599904
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -8,20 +8,21 @@
"""Extract image-urls from https://yande.re/"""
from .booru import JSONBooruExtractor
from . import booru
info = {
"category": "yandere",
"extractor": "YandereExtractor",
"directory": ["{category}", "{tags}"],
"filename": "{category}_{id}_{md5}.{extension}",
"pattern": [
r"(?:https?://)?(?:www\.)?yande\.re/post\?tags=([^&]+).*",
],
}
class YandereExtractor(booru.JSONBooruExtractor):
"""Base class for yandere extractors"""
category = "yandere"
api_url = "https://yande.re/post.json"
class YandereExtractor(JSONBooruExtractor):
class YandereTagExtractor(YandereExtractor, booru.BooruTagExtractor):
"""Extract images from yandere based on search-tags"""
pattern = [r"(?:https?://)?(?:www\.)?yande\.re/post\?tags=([^&]+)"]
def __init__(self, match):
JSONBooruExtractor.__init__(self, match, info)
self.api_url = "https://yande.re/post.json"
class YanderePoolExtractor(YandereExtractor, booru.BooruPoolExtractor):
"""Extract image-pools from yandere"""
pattern = [r"(?:https?://)?(?:www\.)?yande.re/pool/show/(\d+)"]
class YanderePostExtractor(YandereExtractor, booru.BooruPostExtractor):
"""Extract single images from yandere"""
pattern = [r"(?:https?://)?(?:www\.)?yande.re/post/show/(\d+)"]