fix: cover image AttributeError brought by "failedtoload" inspecting update

This commit is contained in:
cxumol 2026-02-02 08:41:30 -08:00 committed by GitHub
parent 17331e9eb3
commit f55f9ae902
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -184,7 +184,7 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter):
if storyImage:
coverurl = storyImage['data-fullsize']
# try setting from data-fullsize, if fails, try using data-src
if self.setCoverImage(self.url,coverurl)[0].startswith("failedtoload"):
if str(self.setCoverImage(self.url,coverurl)[0] or '').startswith("failedtoload"):
coverurl = storyImage['src']
self.setCoverImage(self.url,coverurl)

View file

@ -289,7 +289,7 @@ class RoyalRoadAdapter(BaseSiteAdapter):
if img:
cover_url = img['src']
# usually URL is for thumbnail. Try expected URL for larger image, if fails fall back to the original URL
if self.setCoverImage(url,cover_url.replace('/covers-full/', '/covers-large/'))[0].startswith("failedtoload"):
if str(self.setCoverImage(url,cover_url.replace('/covers-full/', '/covers-large/'))[0] or '').startswith("failedtoload"):
self.setCoverImage(url,cover_url)
# some content is show as tables, this will preserve them