mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Merge branch 'master' of https://github.com/unkn0w7n/calibre
This commit is contained in:
commit
93ab239dae
@ -37,15 +37,11 @@ class LiveMint(BasicNewsRecipe):
|
|||||||
self.oldest_article = float(d)
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
def get_cover_url(self):
|
def get_cover_url(self):
|
||||||
today = date.today().strftime('%d/%m/%Y')
|
soup = self.index_to_soup('https://epaper.livemint.com/')
|
||||||
today = today.replace('/', '%2F')
|
cov = soup.findAll('img', attrs={'src': lambda x: x and x.startswith('/EPAPERIMAGES')})
|
||||||
raw = self.index_to_soup(
|
for x in cov:
|
||||||
'https://epaper.livemint.com/Home/GetAllpages?editionid=1&editiondate=' + today,
|
if 'MINT_FRONT_1' in x['src']:
|
||||||
raw=True
|
return 'https://epaper.livemint.com' + x['src'].replace('-S', '')
|
||||||
)
|
|
||||||
for cov in json.loads(raw):
|
|
||||||
if cov['NewsProPageTitle'].lower().startswith(('front', 'cover')):
|
|
||||||
return cov['HighResolution']
|
|
||||||
|
|
||||||
extra_css = """
|
extra_css = """
|
||||||
img {margin:0 auto;}
|
img {margin:0 auto;}
|
||||||
@ -149,6 +145,7 @@ class LiveMint(BasicNewsRecipe):
|
|||||||
)
|
)
|
||||||
if summ:
|
if summ:
|
||||||
summ['class'] = 'summary'
|
summ['class'] = 'summary'
|
||||||
|
summ.name = 'p'
|
||||||
for strong in soup.findAll('strong'):
|
for strong in soup.findAll('strong'):
|
||||||
if strong.find('p'):
|
if strong.find('p'):
|
||||||
strong.name = 'div'
|
strong.name = 'div'
|
||||||
|
@ -24,6 +24,7 @@ class outlook(BasicNewsRecipe):
|
|||||||
.main-img-div, .sb-image {font-size:small; text-align:center;}
|
.main-img-div, .sb-image {font-size:small; text-align:center;}
|
||||||
em { color:#202020; }
|
em { color:#202020; }
|
||||||
'''
|
'''
|
||||||
|
browser_type = 'webengine'
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
# classes('story-slug story-title subcap-story article-name-date main-img-div sb-article')
|
# classes('story-slug story-title subcap-story article-name-date main-img-div sb-article')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user