1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-24 03:32:33 +01:00
gallery-dl/gallery_dl/extractor/konachan.py
2015-11-30 01:11:13 +01:00

32 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2015 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Extract image-urls from https://konachan.com/"""
from . import booru
class KonachanExtractor(booru.JSONBooruExtractor):
"""Base class for konachan extractors"""
category = "konachan"
api_url = "https://konachan.com/post.json"
class KonachanTagExtractor(KonachanExtractor, booru.BooruTagExtractor):
"""Extract images from konachan based on search-tags"""
subcategory = "tag"
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/post\?tags=([^&]+)"]
class KonachanPoolExtractor(KonachanExtractor, booru.BooruPoolExtractor):
"""Extract image-pools from konachan"""
subcategory = "pool"
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/pool/show/(\d+)"]
class KonachanPostExtractor(KonachanExtractor, booru.BooruPostExtractor):
"""Extract single images from konachan"""
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/post/show/(\d+)"]