Ignore failures to set the timefmt in the LRB recipe

This commit is contained in:
Kovid Goyal 2019-05-24 07:44:11 +05:30
parent ba5f3cdce7
commit 77966f6c7d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -45,8 +45,11 @@ class LondonReviewOfBooksPayed(BasicNewsRecipe):
soup = self.index_to_soup(self.INDEX)
cover_item = soup.find('p', attrs={'class': 'cover'})
dates = type(u'')(soup.find('span', attrs={'class': 'coverdate'}))
newdates = re.sub(r'\<.*\>', '', re.split(r'<br\s*/>', dates)[1])
self.timefmt = ' [%s]' % newdates
try:
newdates = re.sub(r'\<.*\>', '', re.split(r'<br\s*/>', dates)[1])
self.timefmt = ' [%s]' % newdates
except Exception:
pass
lrbtitle = self.title
if cover_item:
self.cover_url = re.sub('/m/', '/l/', cover_item.a.img['src'])