mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/unkn0w7n/calibre
This commit is contained in:
commit
6865c5eea3
@ -123,7 +123,8 @@ def load_article_from_web_json(raw):
|
|||||||
data = json.loads(raw)['props']['pageProps']['cp2Content']
|
data = json.loads(raw)['props']['pageProps']['cp2Content']
|
||||||
body += f'<div style="color: red; font-size:small; font-weight:bold;">{data.get("flyTitle", "")}</div>'
|
body += f'<div style="color: red; font-size:small; font-weight:bold;">{data.get("flyTitle", "")}</div>'
|
||||||
body += f'<h1>{data["headline"]}</h1>'
|
body += f'<h1>{data["headline"]}</h1>'
|
||||||
body += f'<div style="font-style: italic; color:#202020;">{data.get("rubric", "")}</div>'
|
if data.get("rubric") and data.get("rubric") is not None:
|
||||||
|
body += f'<div style="font-style: italic; color:#202020;">{data.get("rubric", "")}</div>'
|
||||||
try:
|
try:
|
||||||
date = data['dateModified']
|
date = data['dateModified']
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -123,7 +123,8 @@ def load_article_from_web_json(raw):
|
|||||||
data = json.loads(raw)['props']['pageProps']['cp2Content']
|
data = json.loads(raw)['props']['pageProps']['cp2Content']
|
||||||
body += f'<div style="color: red; font-size:small; font-weight:bold;">{data.get("flyTitle", "")}</div>'
|
body += f'<div style="color: red; font-size:small; font-weight:bold;">{data.get("flyTitle", "")}</div>'
|
||||||
body += f'<h1>{data["headline"]}</h1>'
|
body += f'<h1>{data["headline"]}</h1>'
|
||||||
body += f'<div style="font-style: italic; color:#202020;">{data.get("rubric", "")}</div>'
|
if data.get("rubric") and data.get("rubric") is not None:
|
||||||
|
body += f'<div style="font-style: italic; color:#202020;">{data.get("rubric", "")}</div>'
|
||||||
try:
|
try:
|
||||||
date = data['dateModified']
|
date = data['dateModified']
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -98,13 +98,13 @@ class TheHindu(BasicNewsRecipe):
|
|||||||
raw = self.index_to_soup(url, raw=True)
|
raw = self.index_to_soup(url, raw=True)
|
||||||
soup = self.index_to_soup(raw)
|
soup = self.index_to_soup(raw)
|
||||||
ans = self.hindu_parse_index(soup)
|
ans = self.hindu_parse_index(soup)
|
||||||
cover = soup.find(attrs={'class':'hindu-ad'})
|
|
||||||
if cover:
|
|
||||||
self.cover_url = cover.img['src']
|
|
||||||
if not ans:
|
if not ans:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
'The Hindu Newspaper is not published Today.'
|
'The Hindu Newspaper is not published Today.'
|
||||||
)
|
)
|
||||||
|
cover = soup.find(attrs={'class':'hindu-ad'})
|
||||||
|
if cover:
|
||||||
|
self.cover_url = cover.img['src']
|
||||||
if mag_url:
|
if mag_url:
|
||||||
self.log('\nFetching Magazine')
|
self.log('\nFetching Magazine')
|
||||||
soup = self.index_to_soup(mag_url)
|
soup = self.index_to_soup(mag_url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user