[fanbox] skip 404ed or otherwise invalid posts (#4088)

This commit is contained in:
Mike Fährmann
2023-05-22 18:49:06 +02:00
parent 69865dcc05
commit 4fc9675d48

View File

@@ -52,8 +52,11 @@ class FanboxExtractor(Extractor):
url = text.ensure_http_scheme(url)
body = self.request(url, headers=headers).json()["body"]
for item in body["items"]:
yield self._get_post_data(item["id"])
try:
yield self._get_post_data(item["id"])
except Exception as exc:
self.log.warning("Skipping post %s (%s: %s)",
item["id"], exc.__class__.__name__, exc)
url = body["nextUrl"]
def _get_post_data(self, post_id):