Search for direct post IDs instead of trying to replicate the same results as the initial request.
This commit is contained in:
@@ -105,16 +105,17 @@ class DanbooruExtractor(BaseExtractor):
|
|||||||
posts = posts["posts"]
|
posts = posts["posts"]
|
||||||
|
|
||||||
if self.includes and posts:
|
if self.includes and posts:
|
||||||
if not pages and "only" not in params:
|
params_meta = {
|
||||||
params["page"] = "b{}".format(posts[0]["id"] + 1)
|
"only" : self.includes,
|
||||||
params["only"] = self.includes
|
"limit": len(posts),
|
||||||
|
"tags" : "id:" + ",".join(str(p["id"]) for p in posts),
|
||||||
|
}
|
||||||
data = {
|
data = {
|
||||||
meta["id"]: meta
|
meta["id"]: meta
|
||||||
for meta in self.request(url, params=params).json()
|
for meta in self.request(url, params=params_meta).json()
|
||||||
}
|
}
|
||||||
for post in posts:
|
for post in posts:
|
||||||
post.update(data[post["id"]])
|
post.update(data[post["id"]])
|
||||||
params["only"] = None
|
|
||||||
|
|
||||||
yield from posts
|
yield from posts
|
||||||
|
|
||||||
@@ -155,7 +156,7 @@ BASE_PATTERN = DanbooruExtractor.update({
|
|||||||
"aibooru": {
|
"aibooru": {
|
||||||
"root": None,
|
"root": None,
|
||||||
"pattern": r"(?:safe.)?aibooru\.online",
|
"pattern": r"(?:safe.)?aibooru\.online",
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user