diff --git a/recipes/livemint.recipe b/recipes/livemint.recipe index 789ec79174..d3a23e19cf 100644 --- a/recipes/livemint.recipe +++ b/recipes/livemint.recipe @@ -17,6 +17,8 @@ class LiveMint(BasicNewsRecipe): use_embedded_content = False no_stylesheets = True remove_attributes = ['style', 'height', 'width'] + masthead_url = 'https://images.livemint.com/static/livemint-logo-v1.svg' + cover_url = 'https://epsfs.hindustantimes.com/MINT/2022/04/06/Delhi/Delhi/5_01/9376f23b_01_mr.jpg' if is_saturday: keep_only_tags = [ diff --git a/recipes/toi.recipe b/recipes/toi.recipe index 86120d2ca3..3dfdaaa9dc 100644 --- a/recipes/toi.recipe +++ b/recipes/toi.recipe @@ -8,6 +8,12 @@ timesofindia.indiatimes.com from calibre.web.feeds.news import BasicNewsRecipe +def classes(classes): + q = frozenset(classes.split(' ')) + return dict(attrs={ + 'class': lambda x: x and frozenset(x.split()).intersection(q)}) + + class TheEconomicTimes(BasicNewsRecipe): title = 'The Times of India' __author__ = 'Karthik' @@ -40,7 +46,9 @@ class TheEconomicTimes(BasicNewsRecipe): remove_tags_before = dict(name='h1') remove_tags_after = dict(name='div', attrs={'class': 'storycontent'}) remove_attributes = ['xmlns', 'style'] - remove_tags = [dict(name='div', attrs={'class': 'readalso'})] + remove_tags = [ + classes('readalso success_screen poll_withoutLogin hide') + ] feeds = [('Recent Stories', 'http://timesofindia.indiatimes.com/rssfeeds/1221656.cms'), ('India', 'http://timesofindia.indiatimes.com/rssfeeds/-2128936835.cms'),