use large cover images on royalroad (#823)

This commit is contained in:
Sidney Markowitz 2022-04-09 02:46:34 +12:00 committed by GitHub
parent 3a35e4d2d0
commit 890f416eae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,7 +221,9 @@ class RoyalRoadAdapter(BaseSiteAdapter):
img = soup.find(None,{'class':'row fic-header'}).find('img')
if img:
cover_url = img['src']
self.setCoverImage(url,cover_url)
# 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] == "failedtoload":
self.setCoverImage(url,cover_url)
# some content is show as tables, this will preserve them
itag = soup.find('i',title='Story Length')