[zerochan] fetch metadata for each post separately (#5869)
instead of processing all posts at once before returning any of them
This commit is contained in:
@@ -192,13 +192,13 @@ class ZerochanTagExtractor(ZerochanExtractor):
|
|||||||
post_id = post["id"]
|
post_id = post["id"]
|
||||||
post.update(self._parse_entry_html(post_id))
|
post.update(self._parse_entry_html(post_id))
|
||||||
post.update(self._parse_entry_api(post_id))
|
post.update(self._parse_entry_api(post_id))
|
||||||
|
yield post
|
||||||
else:
|
else:
|
||||||
for post in posts:
|
for post in posts:
|
||||||
base = static + str(post["id"])
|
base = static + str(post["id"])
|
||||||
post["file_url"] = base + ".jpg"
|
post["file_url"] = base + ".jpg"
|
||||||
post["_fallback"] = (base + ".png",)
|
post["_fallback"] = (base + ".png",)
|
||||||
|
yield post
|
||||||
yield from posts
|
|
||||||
|
|
||||||
if not data.get("next"):
|
if not data.get("next"):
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user