mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 12:12:34 +01:00
[konachan] update to new format
This commit is contained in:
parent
23208a49b8
commit
63a38edd05
@ -8,20 +8,21 @@
|
||||
|
||||
"""Extract image-urls from https://konachan.com/"""
|
||||
|
||||
from .booru import JSONBooruExtractor
|
||||
from . import booru
|
||||
|
||||
info = {
|
||||
"category": "konachan",
|
||||
"extractor": "KonachanExtractor",
|
||||
"directory": ["{category}", "{tags}"],
|
||||
"filename": "{category}_{id}_{md5}.{extension}",
|
||||
"pattern": [
|
||||
r"(?:https?://)?(?:www\.)?konachan\.com/post\?tags=([^&]+).*",
|
||||
],
|
||||
}
|
||||
class KonachanExtractor(booru.JSONBooruExtractor):
|
||||
"""Base class for konachan extractors"""
|
||||
category = "konachan"
|
||||
api_url = "https://konachan.com/post.json"
|
||||
|
||||
class KonachanExtractor(JSONBooruExtractor):
|
||||
class KonachanTagExtractor(KonachanExtractor, booru.BooruTagExtractor):
|
||||
"""Extract images from konachan based on search-tags"""
|
||||
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/post\?tags=([^&]+)"]
|
||||
|
||||
def __init__(self, match):
|
||||
JSONBooruExtractor.__init__(self, match, info)
|
||||
self.api_url = "http://konachan.com/post.json"
|
||||
class KonachanPoolExtractor(KonachanExtractor, booru.BooruPoolExtractor):
|
||||
"""Extract image-pools from konachan"""
|
||||
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/pool/show/(\d+)"]
|
||||
|
||||
class KonachanPostExtractor(KonachanExtractor, booru.BooruPostExtractor):
|
||||
"""Extract single images from konachan"""
|
||||
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/post/show/(\d+)"]
|
||||
|
Loading…
Reference in New Issue
Block a user