diff --git a/recipes/business_standard_print.recipe b/recipes/business_standard_print.recipe index 0a05f67f35..f5b31a8588 100644 --- a/recipes/business_standard_print.recipe +++ b/recipes/business_standard_print.recipe @@ -48,10 +48,7 @@ class BusinessStandardPrint(BasicNewsRecipe): soup = self.index_to_soup( 'https://www.magzter.com/IN/Business-Standard-Private-Ltd/Business-Standard/Newspaper/' ) - for citem in soup.findAll( - 'meta', content=lambda s: s and s.endswith('view/3.jpg') - ): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] def parse_index(self): today = datetime.today().strftime('%d-%m-%Y') diff --git a/recipes/hindu_business_line.recipe b/recipes/hindu_business_line.recipe index c71e0312ad..592fb618d6 100644 --- a/recipes/hindu_business_line.recipe +++ b/recipes/hindu_business_line.recipe @@ -24,10 +24,7 @@ class BusinessLine(BasicNewsRecipe): soup = self.index_to_soup( 'https://www.magzter.com/IN/THG-publishing-pvt-ltd/The-Hindu-Business-Line/Newspaper/' ) - for citem in soup.findAll( - 'meta', content=lambda s: s and s.endswith('view/3.jpg') - ): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] keep_only_tags = [ classes( diff --git a/recipes/hindustan.recipe b/recipes/hindustan.recipe index 262ef267f1..502f2e6f3a 100644 --- a/recipes/hindustan.recipe +++ b/recipes/hindustan.recipe @@ -44,5 +44,4 @@ class LiveHindustan(BasicNewsRecipe): def get_cover_url(self): soup = self.index_to_soup('https://www.magzter.com/IN/HT-Digital-Streams-Ltd./Hindustan-Times-Hindi-New-Delhi/Newspaper/') - for citem in soup.findAll('meta', content=lambda s: s and s.endswith('view/3.jpg')): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] diff --git a/recipes/hindustan_times.recipe b/recipes/hindustan_times.recipe index dd6168943e..6f9dfc2928 100644 --- a/recipes/hindustan_times.recipe +++ b/recipes/hindustan_times.recipe @@ -51,8 +51,7 @@ class HindustanTimes(BasicNewsRecipe): def get_cover_url(self): soup = self.index_to_soup('https://www.magzter.com/IN/HT-Digital-Streams-Ltd./Hindustan-Times-Delhi/Newspaper/') - for citem in soup.findAll('meta', content=lambda s: s and s.endswith('view/3.jpg')): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] def preprocess_html(self, soup): for img in soup.findAll('img', attrs={'data-src': True}): diff --git a/recipes/muy_interesante_mexico.recipe b/recipes/muy_interesante_mexico.recipe index 9aebe50a0e..32050060b7 100644 --- a/recipes/muy_interesante_mexico.recipe +++ b/recipes/muy_interesante_mexico.recipe @@ -22,10 +22,7 @@ class MuyInteresante(BasicNewsRecipe): soup = self.index_to_soup( 'https://www.magzter.com/ES/Zinet-Media-Global/Muy-Interesante-Espa%C3%B1a/Science/1806044' ) - for citem in soup.findAll( - 'meta', content=lambda s: s and s.endswith('view/3.jpg') - ): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] extra_css = ''' .c-detail__bar, .c-detail__author, .c-detail__media__txt { font-size:small; } diff --git a/recipes/pc_world.recipe b/recipes/pc_world.recipe index 589745a526..2fe021ba5b 100644 --- a/recipes/pc_world.recipe +++ b/recipes/pc_world.recipe @@ -94,5 +94,4 @@ class pcWorld(BasicNewsRecipe): soup = self.index_to_soup( 'https://www.magzter.com/US/IDG-Consumer-and-SMB,-Inc./PCWorld/Computer-&-Mobile/' ) - for citem in soup.findAll('meta', content=lambda s: s and s.endswith('view/3.jpg')): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] diff --git a/recipes/revista_muy.recipe b/recipes/revista_muy.recipe index b24397fd93..314bb92a8d 100644 --- a/recipes/revista_muy.recipe +++ b/recipes/revista_muy.recipe @@ -19,10 +19,7 @@ class RevistaMuyInteresante(BasicNewsRecipe): soup = self.index_to_soup( 'https://www.magzter.com/ES/Zinet-Media-Global/Muy-Interesante-Espa%C3%B1a/Science/1806044' ) - for citem in soup.findAll( - 'meta', content=lambda s: s and s.endswith('view/3.jpg') - ): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] extra_css = ''' .c-detail__bar, .c-detail__author, .c-detail__media__txt { font-size:small; } diff --git a/recipes/the_week.recipe b/recipes/the_week.recipe index 0e898bd3a0..7aa96b4dac 100644 --- a/recipes/the_week.recipe +++ b/recipes/the_week.recipe @@ -44,10 +44,7 @@ class TheWeek(BasicNewsRecipe): soup = self.index_to_soup( 'https://www.magzter.com/IN/Malayala_Manorama/THE_WEEK/Business/' ) - for citem in soup.findAll( - 'meta', content=lambda s: s and s.endswith('view/3.jpg') - ): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] def parse_index(self): issue = 'https://www.theweek.in/theweek.html' diff --git a/recipes/toi.recipe b/recipes/toi.recipe index 31505f7eb2..8b539fbd9d 100644 --- a/recipes/toi.recipe +++ b/recipes/toi.recipe @@ -69,8 +69,7 @@ class TheEconomicTimes(BasicNewsRecipe): def get_cover_url(self): soup = self.index_to_soup('https://www.magzter.com/IN/Bennett-Coleman-and-Company-Limited/The-Times-of-India-Delhi/Newspaper/') - for citem in soup.findAll('meta', content=lambda s: s and s.endswith('view/3.jpg')): - return citem['content'] + return soup.find('img', id=lambda s: s and 'mgd__lhd__cover' in s.split())['src'] def get_article_url(self, article): rurl = article.get('guid', None)