[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
This commit is contained in:
@@ -36,9 +36,10 @@ class BooruExtractor(BaseExtractor):
|
|||||||
url = self._file_url(post)
|
url = self._file_url(post)
|
||||||
if url[0] == "/":
|
if url[0] == "/":
|
||||||
url = self.root + url
|
url = self.root + url
|
||||||
except (KeyError, TypeError):
|
except Exception as exc:
|
||||||
self.log.debug("Unable to fetch download URL for post %s "
|
self.log.debug("%s: %s", exc.__class__.__name__, exc)
|
||||||
"(md5: %s)", post.get("id"), post.get("md5"))
|
self.log.warning("Unable to fetch download URL for post %s "
|
||||||
|
"(md5: %s)", post.get("id"), post.get("md5"))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if fetch_html:
|
if fetch_html:
|
||||||
|
|||||||
Reference in New Issue
Block a user