From 152738b691092e3ea3ecaac9374ca47d4da7dbc0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 29 Nov 2009 13:25:11 -0700 Subject: [PATCH] Fix #4032 (NYT wont complete) --- resources/recipes/irish_independent.recipe | 6 +++--- resources/recipes/nytimes.recipe | 2 +- resources/recipes/nytimes_sub.recipe | 5 ++++- src/calibre/ebooks/oeb/base.py | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/recipes/irish_independent.recipe b/resources/recipes/irish_independent.recipe index 268b25b381..e4a98e999d 100644 --- a/resources/recipes/irish_independent.recipe +++ b/resources/recipes/irish_independent.recipe @@ -1,6 +1,6 @@ __license__ = 'GPL v3' __copyright__ = '2009 Neil Grogan' -# +# # Irish Independent Recipe # @@ -10,7 +10,7 @@ class IrishIndependent(BasicNewsRecipe): title = u'Irish Independent' description = 'Irish and World news from Irelands Bestselling Daily Broadsheet' __author__ = 'Neil Grogan' - language = 'en_UK' + language = 'en_GB' oldest_article = 7 max_articles_per_feed = 100 remove_tags_before = dict(id='article') @@ -37,7 +37,7 @@ class IrishIndependent(BasicNewsRecipe): (u'Letters', u'http://www.independent.ie/opinion/letters/rss'), (u'Weather', u'http://www.independent.ie/weather/rss') ] - + # If text only articles are desired #def print_version(self, url): # return '%s?service=Print' % url diff --git a/resources/recipes/nytimes.recipe b/resources/recipes/nytimes.recipe index 89d5656741..26ecf895ef 100644 --- a/resources/recipes/nytimes.recipe +++ b/resources/recipes/nytimes.recipe @@ -14,7 +14,7 @@ class NYTimes(BasicNewsRecipe): title = 'New York Times Top Stories' __author__ = 'GRiker' - language = _('English') + language = 'en' description = 'Top Stories from the New York Times' # List of sections typically included in Top Stories. Use a keyword from the diff --git a/resources/recipes/nytimes_sub.recipe b/resources/recipes/nytimes_sub.recipe index a2c805c299..a6e903f6dd 100644 --- a/resources/recipes/nytimes_sub.recipe +++ b/resources/recipes/nytimes_sub.recipe @@ -22,7 +22,10 @@ class NYTimes(BasicNewsRecipe): remove_tags_before = dict(id='article') remove_tags_after = dict(id='article') remove_tags = [dict(attrs={'class':['articleTools', 'post-tools', 'side_tool', 'nextArticleLink clearfix']}), - dict(id=['footer', 'toolsRight', 'articleInline', 'navigation', 'archive', 'side_search', 'blog_sidebar', 'side_tool', 'side_index']), + dict(id=['footer', 'toolsRight', 'articleInline', + 'navigation', 'archive', 'side_search', 'blog_sidebar', + 'side_tool', 'side_index', + 'relatedArticles', 'relatedTopics', 'adxSponLink']), dict(name=['script', 'noscript', 'style'])] encoding = 'cp1252' no_stylesheets = True diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 77cef0d22c..05d4cbb256 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -849,7 +849,8 @@ class Manifest(object): try: data = etree.fromstring(data) except: - data=data.replace(':=', '=').replace(':>', '>') + data = data.replace(':=', '=').replace(':>', '>') + data = data.replace('', '') try: data = etree.fromstring(data) except etree.XMLSyntaxError: