From 4ec81468b76a61fbdc404b3e3ba6920dc0bc36c6 Mon Sep 17 00:00:00 2001 From: felinae98 <731499577@qq.com> Date: Wed, 8 Jun 2022 23:08:20 +0800 Subject: [PATCH 1/2] fix #86 --- src/plugins/nonebot_bison/platform/rss.py | 4 ++++ 1 file changed, 4 insertions(+) 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, From 1e72e655caa8b2f0c9946b02585432bb31aca773 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 Jun 2022 17:34:51 +0000 Subject: [PATCH 2/2] :memo: Update changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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))