From 19a332f74d962bd21baae87a264586e21c5cd878 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Thu, 27 Apr 2023 15:33:04 +0530 Subject: [PATCH] Update livemint.recipe --- recipes/livemint.recipe | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/recipes/livemint.recipe b/recipes/livemint.recipe index e63471a28f..4b990afd37 100644 --- a/recipes/livemint.recipe +++ b/recipes/livemint.recipe @@ -21,16 +21,17 @@ class LiveMint(BasicNewsRecipe): remove_empty_feeds = True resolve_internal_links = True - def get_cover_url(self): - soup = self.index_to_soup( - 'https://www.magzter.com/IN/HT-Digital-Streams-Ltd./Mint-Mumbai/Newspaper/' - ) - for citem in soup.findAll('meta', content=lambda s: s and s.endswith('view/3.jpg')): - return citem['content'] - if is_saturday: + + def get_cover_url(self): + soup = self.index_to_soup('https://lifestyle.livemint.com/') + self.title = 'Mint Lounge' + if citem := soup.find('div', attrs={'class':'headLatestIss_cover'}): + return citem.img['src'].replace('_tn.jpg', '_mr.jpg') + + masthead_url = 'https://lifestyle.livemint.com/mintlounge/static-images/lounge-logo.svg' - oldest_article = 6 # days + oldest_article = 6.5 # days extra_css = ''' #story-summary-0 {font-style:italic; color:#202020;} @@ -63,6 +64,13 @@ class LiveMint(BasicNewsRecipe): img['src'] = img['data-img'] return soup else: + + def get_cover_url(self): + soup = self.index_to_soup( + 'https://www.magzter.com/IN/HT-Digital-Streams-Ltd./Mint-Mumbai/Newspaper/' + ) + for citem in soup.findAll('meta', content=lambda s: s and s.endswith('view/3.jpg')): + return citem['content'] extra_css = ''' img {display:block; margin:0 auto;}