32 lines
1.1 KiB
Python
Raw Normal View History

2015-04-15 17:35:30 +02:00
# -*- 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://yande.re/"""
2015-11-21 00:55:40 +01:00
from . import booru
2015-04-15 17:35:30 +02:00
2015-11-21 00:55:40 +01:00
class YandereExtractor(booru.JSONBooruExtractor):
"""Base class for yandere extractors"""
category = "yandere"
api_url = "https://yande.re/post.json"
2015-04-15 17:35:30 +02:00
2015-11-21 00:55:40 +01:00
class YandereTagExtractor(YandereExtractor, booru.BooruTagExtractor):
"""Extract images from yandere based on search-tags"""
2015-11-30 01:11:13 +01:00
subcategory = "tag"
2015-11-21 00:55:40 +01:00
pattern = [r"(?:https?://)?(?:www\.)?yande\.re/post\?tags=([^&]+)"]
2015-04-15 17:35:30 +02:00
2015-11-21 00:55:40 +01:00
class YanderePoolExtractor(YandereExtractor, booru.BooruPoolExtractor):
"""Extract image-pools from yandere"""
2015-11-30 01:11:13 +01:00
subcategory = "pool"
2015-11-21 00:55:40 +01:00
pattern = [r"(?:https?://)?(?:www\.)?yande.re/pool/show/(\d+)"]
class YanderePostExtractor(YandereExtractor, booru.BooruPostExtractor):
"""Extract single images from yandere"""
2015-11-30 01:11:13 +01:00
subcategory = "post"
2015-11-21 00:55:40 +01:00
pattern = [r"(?:https?://)?(?:www\.)?yande.re/post/show/(\d+)"]