mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5749 (SMH news feed broken)
This commit is contained in:
parent
a42985c57c
commit
624dfff639
@ -21,7 +21,7 @@ class Smh_au(BasicNewsRecipe):
|
|||||||
language = 'en_AU'
|
language = 'en_AU'
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
masthead_url = 'http://images.smh.com.au/2010/02/02/1087188/smh-620.jpg'
|
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} '
|
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 = {
|
conversion_options = {
|
||||||
@ -47,7 +47,7 @@ class Smh_au(BasicNewsRecipe):
|
|||||||
for itimg in soup.findAll('img',src=True):
|
for itimg in soup.findAll('img',src=True):
|
||||||
if itimg['src'].endswith('frontpage.jpg'):
|
if itimg['src'].endswith('frontpage.jpg'):
|
||||||
self.cover_url = itimg['src']
|
self.cover_url = itimg['src']
|
||||||
|
|
||||||
for item in soup.findAll(attrs={'class':'cN-storyHeadlineLead cfix'}):
|
for item in soup.findAll(attrs={'class':'cN-storyHeadlineLead cfix'}):
|
||||||
description = ''
|
description = ''
|
||||||
title_prefix = ''
|
title_prefix = ''
|
||||||
@ -65,4 +65,4 @@ class Smh_au(BasicNewsRecipe):
|
|||||||
,'url' :url
|
,'url' :url
|
||||||
,'description':description
|
,'description':description
|
||||||
})
|
})
|
||||||
return [(soup.head.title.string, articles)]
|
return [(self.tag_to_string(soup.find('title')), articles)]
|
||||||
|
@ -137,7 +137,7 @@ class Feed(object):
|
|||||||
|
|
||||||
def populate_from_preparsed_feed(self, title, articles, oldest_article=7,
|
def populate_from_preparsed_feed(self, title, articles, oldest_article=7,
|
||||||
max_articles_per_feed=100):
|
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.description = ''
|
||||||
self.image_url = None
|
self.image_url = None
|
||||||
self.articles = []
|
self.articles = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user