Update Private Eye

Fix #1782759 [Private Eye news fetch fails](https://bugs.launchpad.net/calibre/+bug/1782759)
This commit is contained in:
Kovid Goyal 2018-07-20 21:28:32 +05:30
parent 062c0ba07d
commit 2f915e33f6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -165,7 +165,7 @@ class PrivateEyeRecipe(BasicNewsRecipe):
current_section = piece.string current_section = piece.string
elif tag_class == ('a', 'header'): elif tag_class == ('a', 'header'):
self.add_article(title, url, r"\r\n".join(descriptions)) self.add_article(title, url, r"\r\n".join(descriptions))
title = piece.string.rstrip(u' »').strip() title = self.tag_to_string(piece).rstrip(u' »').strip()
url = self.fix_url(piece.get('href', '')) url = self.fix_url(piece.get('href', ''))
descriptions = [] descriptions = []
else: else:
@ -198,7 +198,7 @@ class PrivateEyeRecipe(BasicNewsRecipe):
url = self.fix_url(title_tag.get('href', '')) url = self.fix_url(title_tag.get('href', ''))
desc_tag = more.find('a', {'class': 'header'}) desc_tag = more.find('a', {'class': 'header'})
if desc_tag: if desc_tag:
descriptions.append(desc_tag.string) descriptions.append(self.tag_to_string(desc_tag))
if not url: if not url:
url = self.fix_url(desc_tag.get('href', '')) url = self.fix_url(desc_tag.get('href', ''))
self.add_article(title, url, r"\r\n".join(descriptions)) self.add_article(title, url, r"\r\n".join(descriptions))