This commit is contained in:
Kovid Goyal 2019-08-30 06:41:15 +05:30
parent 9796c9f80c
commit 260c330da3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 4 additions and 3 deletions

View File

@ -51,7 +51,7 @@ class Nature(BasicNewsRecipe):
'img', attrs={'data-test': check_words('issue-cover-image')} 'img', attrs={'data-test': check_words('issue-cover-image')}
)['src'] )['src']
try: try:
self.cover_url = self.cover_url.replace("w200","w500") # enlarge cover size resolution self.cover_url = self.cover_url.replace("w200","w500") # enlarge cover size resolution
except: except:
""" """
failed, img src might have changed, use default width 200 failed, img src might have changed, use default width 200

View File

@ -82,9 +82,9 @@ class NewYorker(BasicNewsRecipe):
cover_url_width_index = self.cover_url.find("w_") cover_url_width_index = self.cover_url.find("w_")
old_width = self.cover_url[cover_url_width_index:cover_url_width_index+5] old_width = self.cover_url[cover_url_width_index:cover_url_width_index+5]
self.cover_url = self.cover_url.replace(old_width, "w_560") self.cover_url = self.cover_url.replace(old_width, "w_560")
except Exception as e: except Exception:
self.log('Failed enlarging cover img, using the original one') self.log('Failed enlarging cover img, using the original one')
self.log('Found cover:', self.cover_url) self.log('Found cover:', self.cover_url)
stories = defaultdict(list) stories = defaultdict(list)
last_section = 'Unknown' last_section = 'Unknown'

View File

@ -5,6 +5,7 @@ import sys
from polyglot.builtins import unicode_type from polyglot.builtins import unicode_type
class CheckEncoding: class CheckEncoding:
def __init__(self, bug_handler): def __init__(self, bug_handler):