mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #7887 (The news fetch for "Times of India" and "The Economic Times" (ENGLISH_ INDIA) not working.)
This commit is contained in:
parent
fd20c4ac7f
commit
4c947784ce
@ -4,6 +4,7 @@ __copyright__ = '2008-2010, Darko Miletic <darko.miletic at gmail.com>'
|
|||||||
economictimes.indiatimes.com
|
economictimes.indiatimes.com
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class TheEconomicTimes(BasicNewsRecipe):
|
class TheEconomicTimes(BasicNewsRecipe):
|
||||||
@ -32,18 +33,17 @@ class TheEconomicTimes(BasicNewsRecipe):
|
|||||||
, 'language' : language
|
, 'language' : language
|
||||||
}
|
}
|
||||||
|
|
||||||
keep_only_tags = [dict(attrs={'class':'printdiv'})]
|
|
||||||
remove_tags = [dict(name=['object','link','embed','iframe','base','table','meta'])]
|
|
||||||
remove_attributes = ['name']
|
|
||||||
|
|
||||||
|
remove_tags_before = dict(name='h1')
|
||||||
feeds = [(u'All articles', u'http://economictimes.indiatimes.com/rssfeedsdefault.cms')]
|
feeds = [(u'All articles', u'http://economictimes.indiatimes.com/rssfeedsdefault.cms')]
|
||||||
|
|
||||||
def print_version(self, url):
|
def print_version(self, url):
|
||||||
rest, sep, art = url.rpartition('/articleshow/')
|
rest, sep, art = url.rpartition('/articleshow/')
|
||||||
|
return 'http://m.economictimes.com/PDAET/articleshow/' + art
|
||||||
return 'http://economictimes.indiatimes.com/articleshow/' + art + '?prtpage=1'
|
return 'http://economictimes.indiatimes.com/articleshow/' + art + '?prtpage=1'
|
||||||
|
|
||||||
def get_article_url(self, article):
|
def get_article_url(self, article):
|
||||||
rurl = article.get('link', None)
|
rurl = article.get('guid', None)
|
||||||
if (rurl.find('/quickieslist/') > 0) or (rurl.find('/quickiearticleshow/') > 0):
|
if (rurl.find('/quickieslist/') > 0) or (rurl.find('/quickiearticleshow/') > 0):
|
||||||
return None
|
return None
|
||||||
return rurl
|
return rurl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user