diff --git a/CHANGELOG.md b/CHANGELOG.md index f77cd73..615ddb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/src/plugins/nonebot_bison/platform/rss.py b/src/plugins/nonebot_bison/platform/rss.py index ed09e8a..b8f6ada 100644 --- a/src/plugins/nonebot_bison/platform/rss.py +++ b/src/plugins/nonebot_bison/platform/rss.py @@ -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,