This commit is contained in:
Kovid Goyal 2024-12-27 21:37:29 +05:30
commit 93ab239dae
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 9 deletions

View File

@ -37,15 +37,11 @@ class LiveMint(BasicNewsRecipe):
self.oldest_article = float(d)
def get_cover_url(self):
today = date.today().strftime('%d/%m/%Y')
today = today.replace('/', '%2F')
raw = self.index_to_soup(
'https://epaper.livemint.com/Home/GetAllpages?editionid=1&editiondate=' + today,
raw=True
)
for cov in json.loads(raw):
if cov['NewsProPageTitle'].lower().startswith(('front', 'cover')):
return cov['HighResolution']
soup = self.index_to_soup('https://epaper.livemint.com/')
cov = soup.findAll('img', attrs={'src': lambda x: x and x.startswith('/EPAPERIMAGES')})
for x in cov:
if 'MINT_FRONT_1' in x['src']:
return 'https://epaper.livemint.com' + x['src'].replace('-S', '')
extra_css = """
img {margin:0 auto;}
@ -149,6 +145,7 @@ class LiveMint(BasicNewsRecipe):
)
if summ:
summ['class'] = 'summary'
summ.name = 'p'
for strong in soup.findAll('strong'):
if strong.find('p'):
strong.name = 'div'

View File

@ -24,6 +24,7 @@ class outlook(BasicNewsRecipe):
.main-img-div, .sb-image {font-size:small; text-align:center;}
em { color:#202020; }
'''
browser_type = 'webengine'
keep_only_tags = [
# classes('story-slug story-title subcap-story article-name-date main-img-div sb-article')