mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Updated FAZ.NET recipe to produce EPUB that does not crash the SONY readers.
This commit is contained in:
parent
a5a5420944
commit
2a7c0bab5e
5855
src/calibre/translations/da.po
Normal file
5855
src/calibre/translations/da.po
Normal file
File diff suppressed because it is too large
Load Diff
5809
src/calibre/translations/ja.po
Normal file
5809
src/calibre/translations/ja.po
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,29 +1,50 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2008-2009, Kovid Goyal <kovid at kovidgoyal.net>, Darko Miletic <darko at gmail.com>'
|
||||||
'''
|
'''
|
||||||
Profile to download FAZ.net
|
Profile to download FAZ.net
|
||||||
'''
|
'''
|
||||||
import re
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class FazNet(BasicNewsRecipe):
|
||||||
class FazNet(BasicNewsRecipe):
|
title = 'FAZ NET'
|
||||||
|
__author__ = 'Kovid Goyal, Darko Miletic'
|
||||||
title = 'FAZ NET'
|
description = 'Frankfurter Allgemeine Zeitung'
|
||||||
__author__ = 'Kovid Goyal'
|
publisher = 'FAZ Electronic Media GmbH'
|
||||||
description = 'Frankfurter Allgemeine Zeitung'
|
category = 'news, politics, Germany'
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
language = _('German')
|
language = _('German')
|
||||||
max_articles_per_feed = 30
|
max_articles_per_feed = 30
|
||||||
|
no_stylesheets = True
|
||||||
preprocess_regexps = [
|
encoding = 'utf-8'
|
||||||
(re.compile(r'Zum Thema</span>.*?</BODY>', re.IGNORECASE | re.DOTALL),
|
remove_javascript = True
|
||||||
lambda match : ''),
|
|
||||||
]
|
html2lrf_options = [
|
||||||
|
'--comment', description
|
||||||
|
, '--category', category
|
||||||
feeds = [ ('FAZ.NET', 'http://www.faz.net/s/Rub/Tpl~Epartner~SRss_.xml') ]
|
, '--publisher', publisher
|
||||||
|
]
|
||||||
def print_version(self, url):
|
|
||||||
return url.replace('.html?rss_aktuell', '~Afor~Eprint.html')
|
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||||
|
|
||||||
|
keep_only_tags = [dict(name='div', attrs={'class':'Article'})]
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['object','link','embed','base'])
|
||||||
|
,dict(name='div', attrs={'class':['LinkBoxModulSmall','ModulVerlagsInfo']})
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
feeds = [ ('FAZ.NET', 'http://www.faz.net/s/Rub/Tpl~Epartner~SRss_.xml') ]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
article, sep, rest = url.partition('?')
|
||||||
|
return article.replace('.html', '~Afor~Eprint.html')
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
mtag = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>'
|
||||||
|
soup.head.insert(0,mtag)
|
||||||
|
del soup.body['onload']
|
||||||
|
for item in soup.findAll(style=True):
|
||||||
|
del item['style']
|
||||||
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user