From 9ea6965985ec6f852ce3e2fc317baaf8ed0b7bef Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sat, 26 Dec 2020 20:31:53 +0800 Subject: [PATCH] fix rss --- worker/rss.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/rss.py b/worker/rss.py index 59375cd..36c561e 100644 --- a/worker/rss.py +++ b/worker/rss.py @@ -44,7 +44,7 @@ class Ans(StdAns): try: d = feedparser.parse(suburl) title = d.feed.title - lastUpdated = d.feed.updated + lastUpdated = d.entries[0].published except: return "咱好像没能成功订阅 (╥_╥)" @@ -89,13 +89,13 @@ class Ans(StdAns): except: self.sendmsg(f"咱抓取不到 《{sub['title']}》!") continue - if d.feed.updated == sub['lastUpdated']: + if d.entries[0].published == sub['lastUpdated']: continue newfeedtitle = d.entries[0].title newfeedlink = d.entries[0].link self.push(sub['title'], newfeedtitle, newfeedlink) - nowdata['allSub'][sub['url']]['lastUpdated'] = d.feed.updated + nowdata['allSub'][sub['url']]['lastUpdated'] = d.entries[0].published self.DATASET({gid:json.dumps(nowdata)}) elif cmd == 'disable':