[booru] add "popular" extractors for more sites

- konachan.com
- behoimi.org
- e621.net
This commit is contained in:
Mike Fährmann
2017-08-26 23:08:52 +02:00
parent 07214f4007
commit 88a386977e
3 changed files with 42 additions and 0 deletions

View File

@@ -50,3 +50,18 @@ class ThreedeebooruPostExtractor(ThreedeebooruExtractor,
"url": "ce874ea26f01d6c94795f3cc3aaaaa9bc325f2f6",
"content": "26549d55b82aa9a6c1686b96af8bfcfa50805cd4",
})]
class ThreedeebooruPopularExtractor(ThreedeebooruExtractor,
booru.BooruPopularExtractor):
"""Extractor for popular images from behoimi.org"""
pattern = [r"(?:https?://)?(?:www\.)?behoimi\.org/post/popular_"
r"(by_(?:day|week|month)|recent)(?:\?([^#]*))?"]
test = [("http://behoimi.org/post/popular_by_month?month=6&year=2017", {
"url": "d2f8b04e54b12b8daaa4ba5fbea84d7dabe8a5df",
"count": 20,
})]
@property
def api_url(self):
return "http://behoimi.org/post/popular_" + self.scale + ".json"