Merge branch 'main' of github.com:felinae98/nonebot-bison

This commit is contained in:
felinae98 2022-06-11 23:22:56 +08:00
commit d227a6f49e
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610
2 changed files with 6 additions and 2 deletions

View File

@ -2,10 +2,10 @@
## 最近更新
- 添加新的订阅平台mcbbsnews [@AzideCupric](https://github.com/AzideCupric) ([#84](https://github.com/felinae98/nonebot-bison/pull/84))
### 新功能
- 增加rss对media_content中图片的支持 [@felinae98](https://github.com/felinae98) ([#87](https://github.com/felinae98/nonebot-bison/pull/87))
- 添加新的订阅平台mcbbsnews [@AzideCupric](https://github.com/AzideCupric) ([#84](https://github.com/felinae98/nonebot-bison/pull/84))
- 添加bilibili开播提醒 [@Sichongzou](https://github.com/Sichongzou) ([#60](https://github.com/felinae98/nonebot-bison/pull/60))
- 添加User-Agent配置 [@felinae98](https://github.com/felinae98) ([#78](https://github.com/felinae98/nonebot-bison/pull/78))
- 增加代理设置 [@felinae98](https://github.com/felinae98) ([#71](https://github.com/felinae98/nonebot-bison/pull/71))

View File

@ -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,