[booru] prevent crash when file URL is empty (#5859)

- catch all exceptions, including IndexError,  and not just a select few
- change logging message level to  warning
pull/5870/head
Mike Fährmann 2 months ago
parent 39b9c8d4b0
commit bf44add132
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -36,9 +36,10 @@ class BooruExtractor(BaseExtractor):
url = self._file_url(post)
if url[0] == "/":
url = self.root + url
except (KeyError, TypeError):
self.log.debug("Unable to fetch download URL for post %s "
"(md5: %s)", post.get("id"), post.get("md5"))
except Exception as exc:
self.log.debug("%s: %s", exc.__class__.__name__, exc)
self.log.warning("Unable to fetch download URL for post %s "
"(md5: %s)", post.get("id"), post.get("md5"))
continue
if fetch_html:

Loading…
Cancel
Save