mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-07-11 01:03:00 +08:00
Merge pull request #87 from felinae98/fix/rss-image
增加rss对media_content中图片的支持
This commit is contained in:
commit
c42f4fa1f3
@ -48,6 +48,10 @@ class Rss(NewMessage):
|
||||
soup = bs(raw_post.description, "html.parser")
|
||||
text += soup.text.strip()
|
||||
pics = list(map(lambda x: x.attrs["src"], soup("img")))
|
||||
if raw_post.get("media_content"):
|
||||
for media in raw_post["media_content"]:
|
||||
if media.get("medium") == "image" and media.get("url"):
|
||||
pics.append(media.get("url"))
|
||||
return Post(
|
||||
"rss",
|
||||
text=text,
|
||||
|
Loading…
x
Reference in New Issue
Block a user