From 624dfff639b159f62b34d9c5e9f2e31f0cf359b1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Jun 2010 10:42:07 -0600 Subject: [PATCH] Fix #5749 (SMH news feed broken) --- resources/recipes/smh.recipe | 6 +++--- src/calibre/web/feeds/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/recipes/smh.recipe b/resources/recipes/smh.recipe index 21643b9611..b5c7f4d54e 100644 --- a/resources/recipes/smh.recipe +++ b/resources/recipes/smh.recipe @@ -21,7 +21,7 @@ class Smh_au(BasicNewsRecipe): language = 'en_AU' remove_empty_feeds = True masthead_url = 'http://images.smh.com.au/2010/02/02/1087188/smh-620.jpg' - publication_type = 'newspaper' + publication_type = 'newspaper' extra_css = ' h1{font-family: Georgia,"Times New Roman",Times,serif } body{font-family: Arial,Helvetica,sans-serif} .cT-imageLandscape{font-size: x-small} ' conversion_options = { @@ -47,7 +47,7 @@ class Smh_au(BasicNewsRecipe): for itimg in soup.findAll('img',src=True): if itimg['src'].endswith('frontpage.jpg'): self.cover_url = itimg['src'] - + for item in soup.findAll(attrs={'class':'cN-storyHeadlineLead cfix'}): description = '' title_prefix = '' @@ -65,4 +65,4 @@ class Smh_au(BasicNewsRecipe): ,'url' :url ,'description':description }) - return [(soup.head.title.string, articles)] + return [(self.tag_to_string(soup.find('title')), articles)] diff --git a/src/calibre/web/feeds/__init__.py b/src/calibre/web/feeds/__init__.py index da7122c491..c34334ee09 100644 --- a/src/calibre/web/feeds/__init__.py +++ b/src/calibre/web/feeds/__init__.py @@ -137,7 +137,7 @@ class Feed(object): def populate_from_preparsed_feed(self, title, articles, oldest_article=7, max_articles_per_feed=100): - self.title = title if title else _('Unknown feed') + self.title = unicode(title if title else _('Unknown feed')) self.description = '' self.image_url = None self.articles = []