From f55f9ae902a7610e279e3c8c988566b1de577490 Mon Sep 17 00:00:00 2001 From: cxumol Date: Mon, 2 Feb 2026 08:41:30 -0800 Subject: [PATCH] fix: cover image AttributeError brought by "failedtoload" inspecting update --- fanficfare/adapters/adapter_fimfictionnet.py | 2 +- fanficfare/adapters/adapter_royalroadcom.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fanficfare/adapters/adapter_fimfictionnet.py b/fanficfare/adapters/adapter_fimfictionnet.py index c7def71e..e706e9b4 100644 --- a/fanficfare/adapters/adapter_fimfictionnet.py +++ b/fanficfare/adapters/adapter_fimfictionnet.py @@ -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) diff --git a/fanficfare/adapters/adapter_royalroadcom.py b/fanficfare/adapters/adapter_royalroadcom.py index 07b58c8e..105f9f18 100644 --- a/fanficfare/adapters/adapter_royalroadcom.py +++ b/fanficfare/adapters/adapter_royalroadcom.py @@ -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