enlarge cover img resolution by change the url

kindle app on larger tablets does not show cover
if the cover img resolution is too low.
This commit is contained in:
jn8029 2019-07-30 16:55:29 +08:00
parent b3e1632b07
commit f6c9cde09f

View File

@ -50,6 +50,13 @@ class Nature(BasicNewsRecipe):
self.cover_url = 'https:' + soup.find( self.cover_url = 'https:' + soup.find(
'img', attrs={'data-test': check_words('issue-cover-image')} 'img', attrs={'data-test': check_words('issue-cover-image')}
)['src'] )['src']
try:
self.cover_url = self.cover_url.replace("w200","w500") # enlarge cover size resolution
except:
"""
failed, img src might have changed, use default width 200
"""
pass
section_tags = soup.find( section_tags = soup.find(
'div', {'data-container-type': check_words('issue-section-list')} 'div', {'data-container-type': check_words('issue-section-list')}
) )