mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Merge branch 'enlarge_newyorker_cover_img' of https://github.com/jn8029/calibre
This commit is contained in:
commit
b3e1632b07
1 changed files with 8 additions and 0 deletions
|
|
@ -77,6 +77,14 @@ def parse_index(self):
|
|||
cover_img = cover_img.find('img')
|
||||
if cover_img is not None:
|
||||
self.cover_url = cover_img.get('src')
|
||||
try:
|
||||
# the src original resolution w_280 was too low, replace w_280 with w_560
|
||||
cover_url_width_index = self.cover_url.find("w_")
|
||||
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")
|
||||
except Exception as e:
|
||||
self.log('Failed enlarging cover img, using the original one')
|
||||
|
||||
self.log('Found cover:', self.cover_url)
|
||||
stories = defaultdict(list)
|
||||
last_section = 'Unknown'
|
||||
|
|
|
|||
Loading…
Reference in a new issue