Fixes #1926848 [Private Eye recipe broken](https://bugs.launchpad.net/calibre/+bug/1926848)
This commit is contained in:
Kovid Goyal 2021-05-02 07:32:20 +05:30
commit 47211fff5c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -80,11 +80,11 @@ class PrivateEyeRecipe(BasicNewsRecipe):
return url return url
urls = [] urls = []
publication_date = "" edition_date = ""
def add_article(self, title, url, description="", date=None): def add_article(self, title, url, description="", date=None):
if date is None: if date is None:
date = self.publication_date date = self.edition_date
if url and url not in self.urls: if url and url not in self.urls:
self.urls.append(url) self.urls.append(url)
self.log.info( self.log.info(
@ -139,9 +139,9 @@ class PrivateEyeRecipe(BasicNewsRecipe):
date = datetime.strptime( date = datetime.strptime(
" ".join((day, month, year)), "%d %B %Y") " ".join((day, month, year)), "%d %B %Y")
date = date - timedelta(11) date = date - timedelta(11)
self.publication_date = datetime.strftime( self.edition_date = datetime.strftime(
date, "%d %B %Y").lstrip("0") date, "%d %B %Y").lstrip("0")
self.log.debug("Publication date: %s" % self.publication_date) self.log.debug("Publication date: %s" % self.edition_date)
self.title_with_date = self.title + datetime.strftime( self.title_with_date = self.title + datetime.strftime(
date, " %Y-%m-%d") date, " %Y-%m-%d")
break break