mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Update wsj.recipe
change cover source
This commit is contained in:
parent
194116a302
commit
72cba9ee74
@ -175,15 +175,15 @@ class WSJ(BasicNewsRecipe):
|
||||
d, m, y = dt.split('-')
|
||||
cu = f'https://www.wsj.com/public/resources/documents/WSJNewsPaper-{int(m)}-{int(d)}-{y}.jpg'
|
||||
else:
|
||||
raw = br.open('https://wsjtodaysedition.cmail19.com/t/d-e-suujjg-thithlkhlr-r/')
|
||||
raw = br.open('https://frontpages.freedomforum.org/newspapers/wsj-The_Wall_Street_Journal')
|
||||
soup = BeautifulSoup(raw.read())
|
||||
cu = soup.find(
|
||||
'img',
|
||||
attrs={
|
||||
'class': 'responsive-img',
|
||||
'src': lambda x: x and 'WSJNewsPaper' in x
|
||||
}
|
||||
)['src']
|
||||
'alt': 'Front Page Image',
|
||||
'src': lambda x: x and x.endswith('front-page-large.jpg'),
|
||||
},
|
||||
)['src'].replace('-large', '-medium')
|
||||
self.report_progress(1, _('Downloading cover from %s') % cu)
|
||||
with closing(br.open(cu, timeout=self.timeout)) as r:
|
||||
cdata = r.read()
|
||||
|
Loading…
x
Reference in New Issue
Block a user