[danbooru][e621] remove constructors

This commit is contained in:
Mike Fährmann
2025-03-02 20:38:12 +01:00
parent f15538938e
commit c567bf12e6
2 changed files with 7 additions and 25 deletions

View File

@@ -100,7 +100,7 @@ class E621PoolExtractor(E621Extractor, danbooru.DanbooruPoolExtractor):
example = "https://e621.net/pools/12345"
def posts(self):
self.log.info("Fetching posts of pool %s", self.pool_id)
self.log.info("Collecting posts of pool %s", self.pool_id)
id_to_post = {
post["id"]: post
@@ -126,7 +126,7 @@ class E621PostExtractor(E621Extractor, danbooru.DanbooruPostExtractor):
example = "https://e621.net/posts/12345"
def posts(self):
url = "{}/posts/{}.json".format(self.root, self.post_id)
url = "{}/posts/{}.json".format(self.root, self.groups[-1])
return (self.request(url).json()["post"],)
@@ -147,11 +147,8 @@ class E621FavoriteExtractor(E621Extractor):
pattern = BASE_PATTERN + r"/favorites(?:\?([^#]*))?"
example = "https://e621.net/favorites"
def __init__(self, match):
E621Extractor.__init__(self, match)
self.query = text.parse_query(match.group(match.lastindex))
def metadata(self):
self.query = text.parse_query(self.groups[-1])
return {"user_id": self.query.get("user_id", "")}
def posts(self):