mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #6486 (Economic Times of India - epub in Nook)
This commit is contained in:
parent
51f3364823
commit
54a01f7961
@ -1,13 +1,10 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008-2009, Darko Miletic <darko.miletic at gmail.com>'
|
__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
|
||||||
from calibre.ebooks.BeautifulSoup import Tag
|
|
||||||
|
|
||||||
class TheEconomicTimes(BasicNewsRecipe):
|
class TheEconomicTimes(BasicNewsRecipe):
|
||||||
title = 'The Economic Times India'
|
title = 'The Economic Times India'
|
||||||
@ -21,18 +18,21 @@ class TheEconomicTimes(BasicNewsRecipe):
|
|||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
simultaneous_downloads = 1
|
simultaneous_downloads = 1
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
lang = 'en-IN'
|
language = 'en_IN'
|
||||||
language = 'en_IN'
|
publication_type = 'newspaper'
|
||||||
|
masthead_url = 'http://economictimes.indiatimes.com/photo/2676871.cms'
|
||||||
|
extra_css = """ body{font-family: Arial,Helvetica,sans-serif}
|
||||||
html2lrf_options = [
|
.heading1{font-size: xx-large; font-weight: bold} """
|
||||||
'--comment', description
|
|
||||||
, '--category', category
|
conversion_options = {
|
||||||
, '--publisher', publisher
|
'comment' : description
|
||||||
, '--ignore-tables'
|
, 'tags' : category
|
||||||
]
|
, 'publisher' : publisher
|
||||||
|
, 'language' : language
|
||||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True'
|
}
|
||||||
|
|
||||||
|
keep_only_tags = [dict(attrs={'class':['heading1','headingnext','Normal']})]
|
||||||
|
remove_tags = [dict(name=['object','link','embed','iframe','base','table','meta'])]
|
||||||
|
|
||||||
feeds = [(u'All articles', u'http://economictimes.indiatimes.com/rssfeedsdefault.cms')]
|
feeds = [(u'All articles', u'http://economictimes.indiatimes.com/rssfeedsdefault.cms')]
|
||||||
|
|
||||||
@ -47,11 +47,6 @@ class TheEconomicTimes(BasicNewsRecipe):
|
|||||||
return rurl
|
return rurl
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
soup.html['xml:lang'] = self.lang
|
for item in soup.findAll(style=True):
|
||||||
soup.html['lang'] = self.lang
|
del item['style']
|
||||||
mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)])
|
|
||||||
mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")])
|
|
||||||
soup.head.insert(0,mlang)
|
|
||||||
soup.head.insert(1,mcharset)
|
|
||||||
return self.adeify_images(soup)
|
return self.adeify_images(soup)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user