Cleanup previous PR

We cant use walrus operator in recipes as they can potentially run on
very old versions of python.
This commit is contained in:
Kovid Goyal 2023-11-05 08:21:23 +05:30
parent 5ee4bc6d9a
commit ff63cbb75e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,7 @@ class EpochTimes(BasicNewsRecipe):
]
remove_tags = [
classes('print:hidden h-header shortcode aspect-square'),
dict(name='button', 'svg'),
dict(name=['button', 'svg']),
dict(name='img', attrs={'src':lambda x: x and x.endswith('svg')})
]

View File

@ -35,7 +35,8 @@ class PhilosophyNow(BasicNewsRecipe):
soup = self.index_to_soup('https://philosophynow.org/')
div = soup.find('div', attrs={'id': 'aside_issue_cover'})
url = div.find('a', href=True)['href']
if issue := div.find('div', attrs={'id':'aside_issue_text'}):
issue = div.find('div', attrs={'id':'aside_issue_text'})
if issue:
self.log('Downloading issue:', self.tag_to_string(issue).strip())
self.timefmt = ' [' + self.tag_to_string(issue.find(attrs={'id':'aside_issue_date'})) + ']'
self.title = 'Philosophy Now ' + self.tag_to_string(issue.find(attrs={'id':'aside_issue_number'}))