mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
wsj
This commit is contained in:
parent
732f7ae6e1
commit
61406b11f6
@ -14,11 +14,11 @@ past_edition = None
|
|||||||
def media_bucket(x):
|
def media_bucket(x):
|
||||||
if x.get('type', '') == 'image':
|
if x.get('type', '') == 'image':
|
||||||
return '<img src="{}"><div class="figc">{}</div>\n'.format(
|
return '<img src="{}"><div class="figc">{}</div>\n'.format(
|
||||||
x['manifest-url'], x['caption'] + ' ' + x['credit']
|
x['manifest-url'], x['caption'] + '<i> ' + x['credit'] + '</i>'
|
||||||
)
|
)
|
||||||
if x.get('type', '') == 'video':
|
if x.get('type', '') == 'video':
|
||||||
return '<img src="{}"><div class="figc">{}</div>\n'.format(
|
return '<a href="{}"><img src="{}"></a><div class="figc">{}</div>\n'.format(
|
||||||
x['thumbnail_url'], x['caption'] + ' ' + x['credit']
|
x['share_link'], x['thumbnail_url'], x['caption'] + '<i> ' + x['credit'] + '</i>'
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -90,6 +90,7 @@ class WSJ(BasicNewsRecipe):
|
|||||||
m_itm = soup.findAll('panel', attrs={'class':'media-item'})
|
m_itm = soup.findAll('panel', attrs={'class':'media-item'})
|
||||||
if i_lst and m_itm:
|
if i_lst and m_itm:
|
||||||
for x, y in list(zip_longest(m_itm, i_lst)):
|
for x, y in list(zip_longest(m_itm, i_lst)):
|
||||||
|
x.name = 'p'
|
||||||
x.insert_after(BeautifulSoup(y, 'html.parser'))
|
x.insert_after(BeautifulSoup(y, 'html.parser'))
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
@ -10,11 +10,11 @@ from calibre.web.feeds.news import BasicNewsRecipe, classes
|
|||||||
def media_bucket(x):
|
def media_bucket(x):
|
||||||
if x.get('type', '') == 'image':
|
if x.get('type', '') == 'image':
|
||||||
return '<img src="{}"><div class="figc">{}</div>\n'.format(
|
return '<img src="{}"><div class="figc">{}</div>\n'.format(
|
||||||
x['manifest-url'], x['caption'] + ' ' + x['credit']
|
x['manifest-url'], x['caption'] + '<i> ' + x['credit'] + '</i>'
|
||||||
)
|
)
|
||||||
if x.get('type', '') == 'video':
|
if x.get('type', '') == 'video':
|
||||||
return '<img src="{}"><div class="figc">{}</div>\n'.format(
|
return '<a href="{}"><img src="{}"></a><div class="figc">{}</div>\n'.format(
|
||||||
x['thumbnail_url'], x['caption'] + ' ' + x['credit']
|
x['share_link'], x['thumbnail_url'], x['caption'] + '<i> ' + x['credit'] + '</i>'
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -87,6 +87,7 @@ class WSJ(BasicNewsRecipe):
|
|||||||
m_itm = soup.findAll('panel', attrs={'class':'media-item'})
|
m_itm = soup.findAll('panel', attrs={'class':'media-item'})
|
||||||
if i_lst and m_itm:
|
if i_lst and m_itm:
|
||||||
for x, y in list(zip_longest(m_itm, i_lst)):
|
for x, y in list(zip_longest(m_itm, i_lst)):
|
||||||
|
x.name = 'p'
|
||||||
x.insert_after(BeautifulSoup(y, 'html.parser'))
|
x.insert_after(BeautifulSoup(y, 'html.parser'))
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user