[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)
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user