Update TOI and LiveMint

This commit is contained in:
Kovid Goyal 2022-04-07 15:37:16 +05:30
parent 57fe3de98e
commit e40e387c88
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 11 additions and 1 deletions

View File

@ -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 = [

View File

@ -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'),