diff --git a/resources/recipes/times_online.recipe b/resources/recipes/times_online.recipe index 98e96552ce..7a9e944301 100644 --- a/resources/recipes/times_online.recipe +++ b/resources/recipes/times_online.recipe @@ -76,8 +76,7 @@ class Timesonline(BasicNewsRecipe): soup = self.index_to_soup(index) link_item = soup.find(name = 'div',attrs ={'class': "float-left margin-right-15"}) if link_item: - cover_url = 'http://www.timesonline.co.uk' + link_item.img['src'] - print cover_url + cover_url = link_item.img['src'] return cover_url def get_article_url(self, article): @@ -85,9 +84,9 @@ class Timesonline(BasicNewsRecipe): def preprocess_html(self, soup): - soup.html['xml:lang'] = self.lang - soup.html['lang'] = self.lang - mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + soup.html['xml:lang'] = self.language + soup.html['lang'] = self.language + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.language)]) mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=ISO-8859-1")]) soup.head.insert(0,mlang) soup.head.insert(1,mcharset) diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index 46e8cd005d..db4ce3fda3 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -1179,6 +1179,8 @@ class BasicNewsRecipe(Recipe): body.insert(len(body.contents), elem) with open(last, 'wb') as fi: fi.write(unicode(soup).encode('utf-8')) + if len(feeds) == 0: + raise Exception('All feeds are empty, aborting.') if len(feeds) > 1: for i, f in enumerate(feeds):