mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 12:12:54 +01:00
RSS: Fix feeds with missing description or title
An AttributeError would be raised when a blacklist or a whitelist would be set on feeds that miss either a title or a description.
This commit is contained in:
parent
e2180a1e08
commit
b900a369a4
@ -403,12 +403,15 @@ class RSS(callbacks.Plugin):
|
|||||||
all = __builtins__['all']
|
all = __builtins__['all']
|
||||||
any = __builtins__['any']
|
any = __builtins__['any']
|
||||||
|
|
||||||
|
title = getattr(entry, 'title', '')
|
||||||
|
description = getattr(entry, 'description', '')
|
||||||
|
|
||||||
if whitelist:
|
if whitelist:
|
||||||
if all(kw not in entry.title and kw not in entry.description
|
if all(kw not in title and kw not in description
|
||||||
for kw in whitelist):
|
for kw in whitelist):
|
||||||
return False
|
return False
|
||||||
if blacklist:
|
if blacklist:
|
||||||
if any(kw in entry.title or kw in entry.description
|
if any(kw in title or kw in description
|
||||||
for kw in blacklist):
|
for kw in blacklist):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user