[zerochan] fetch metadata for each post separately (#5869)

instead of processing all posts at once before returning any of them
pull/5870/head
Mike Fährmann 2 months ago
parent 84a634fc14
commit fef80a2f55
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

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

Loading…
Cancel
Save