[e621] support e621.cc and e621.anthro.fr frontend URLs (#6809)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
"""Extractors for https://e621.net/ and other e621 instances"""
|
||||
|
||||
from .common import Message
|
||||
from .common import Extractor, Message
|
||||
from . import danbooru
|
||||
from ..cache import memcache
|
||||
from .. import text, util
|
||||
@@ -156,3 +156,20 @@ class E621FavoriteExtractor(E621Extractor):
|
||||
|
||||
def posts(self):
|
||||
return self._pagination("/favorites.json", self.query)
|
||||
|
||||
|
||||
class E621FrontendExtractor(Extractor):
|
||||
"""Extractor for alternative e621 frontends"""
|
||||
basecategory = "E621"
|
||||
category = "e621"
|
||||
subcategory = "frontend"
|
||||
pattern = r"(?:https?://)?e621\.(?:cc/\?tags|anthro\.fr/\?q)=([^&#]*)"
|
||||
example = "https://e621.cc/?tags=TAG"
|
||||
|
||||
def initialize(self):
|
||||
pass
|
||||
|
||||
def items(self):
|
||||
url = "https://e621.net/posts?tags=" + self.groups[0]
|
||||
data = {"_extractor": E621TagExtractor}
|
||||
yield Message.Queue, url, data
|
||||
|
||||
Reference in New Issue
Block a user