[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:
Mike Fährmann
2024-07-20 02:11:27 +02:00
parent 84a634fc14
commit fef80a2f55

View File

@@ -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