mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-06 03:46:10 +08:00
fix #15
This commit is contained in:
parent
b9a64ee6b5
commit
4e28b791c7
@ -43,7 +43,8 @@ class Rss(NewMessage, TargetMixin):
|
|||||||
return feed.entries
|
return feed.entries
|
||||||
|
|
||||||
async def parse(self, raw_post: RawPost) -> Post:
|
async def parse(self, raw_post: RawPost) -> Post:
|
||||||
|
text = raw_post.get('title', '') + '\n' if raw_post.get('title') else ''
|
||||||
soup = bs(raw_post.description, 'html.parser')
|
soup = bs(raw_post.description, 'html.parser')
|
||||||
text = soup.text.strip()
|
text += soup.text.strip()
|
||||||
pics = list(map(lambda x: x.attrs['src'], soup('img')))
|
pics = list(map(lambda x: x.attrs['src'], soup('img')))
|
||||||
return Post('rss', text=text, url=raw_post.link, pics=pics, target_name=raw_post['_target_name'])
|
return Post('rss', text=text, url=raw_post.link, pics=pics, target_name=raw_post['_target_name'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user