fix sb bug

This commit is contained in:
felinae98 2021-02-09 21:53:18 +08:00
parent 8992999024
commit 5b85a300d4
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610
2 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,7 @@ class Arknights(metaclass=Singleton):
if announce['announceId'] in self.exists_posts['default']:
continue
res.append(await self.parse(announce['webUrl']))
self.exists_posts['default'].add(announce['announceId'])
if None in res:
res.remove(None)
return res
@ -49,6 +50,7 @@ class Arknights(metaclass=Singleton):
pics.append(pic['src'])
else:
return None
return Post('arknights', '', announce_url, pics=pics)
async def fetch_new_post(self, _) -> list[Post]:
try:

View File

@ -13,6 +13,8 @@ class Post:
text_msg = '来源: {}\n{}'.format(self.target_type, self.text)
if self.target_type == 'rss':
res = [await parse_text(text_msg)]
elif self.target_type == 'arknights':
res = []
else:
res = [await parse_text(text_msg), self.url]
else: