diff --git a/.env b/.env index 3ea0318f..7fc4cec2 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ ENVIRONMENT=prod -VERSION='v2.5.1' +VERSION='v2.5.2' diff --git "a/docs/\351\203\250\347\275\262\346\225\231\347\250\213.md" "b/docs/\351\203\250\347\275\262\346\225\231\347\250\213.md" index a7f6638c..cc0032ad 100644 --- "a/docs/\351\203\250\347\275\262\346\225\231\347\250\213.md" +++ "b/docs/\351\203\250\347\275\262\346\225\231\347\250\213.md" @@ -88,12 +88,7 @@ Windows版安装包下载地址:[https://www.python.org/ftp/python/3.8.3/pytho 5. 复制本仓库中 `.env.dev` 文件内容到工程目录下的 `.env.prod` 文件,并根据注释修改 -6. 将以下内容覆盖至工程目录下的 `.env` 文件 - - ``` - ENVIRONMENT=prod - VERSION='v2.5.1' - ``` +6. 复制本仓库中 `.env` 文件内容到工程目录下的 `.env` 文件 #### 已经部署过其它 Nonebot2 机器人 diff --git a/pyproject.toml b/pyproject.toml index 9e335af0..bb4f063e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ELF_RSS" -version = "2.5.1" +version = "2.5.2" description = "ELF_RSS" authors = ["Quan666"] license = "GPL v3" diff --git a/setup.py b/setup.py index ccb6a472..010d36bf 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="ELF_RSS", - version="2.5.1", + version="2.5.2", author="Quan666", author_email="i@oy.mk", description="QQ机器人 RSS订阅 插件,订阅源建议选择 RSSHub", diff --git a/src/plugins/ELF_RSS2/RSS/routes/Parsing/handle_html_tag.py b/src/plugins/ELF_RSS2/RSS/routes/Parsing/handle_html_tag.py index 48ed2704..ba6a2a43 100644 --- a/src/plugins/ELF_RSS2/RSS/routes/Parsing/handle_html_tag.py +++ b/src/plugins/ELF_RSS2/RSS/routes/Parsing/handle_html_tag.py @@ -116,8 +116,10 @@ async def handle_html_tag(html) -> str: "strong", "sub", "table", + "tbody", "td", "th", + "thead", "tr", "u", "ul", @@ -137,7 +139,9 @@ async def handle_html_tag(html) -> str: rss_str = re.sub(r"", "\n", rss_str) # 删除图片、视频标签 - rss_str = re.sub(r"]*>(.*?)?|]+>", "", rss_str) + rss_str = re.sub( + r"]*>(.*?)?|]+>", "", rss_str, flags=re.DOTALL + ) # 去掉多余换行 while "\n\n\n" in rss_str: diff --git a/src/plugins/ELF_RSS2/RSS/rss_parsing.py b/src/plugins/ELF_RSS2/RSS/rss_parsing.py index e6999486..cc6d6db2 100644 --- a/src/plugins/ELF_RSS2/RSS/rss_parsing.py +++ b/src/plugins/ELF_RSS2/RSS/rss_parsing.py @@ -7,7 +7,14 @@ import feedparser import httpx from nonebot.log import logger -from tenacity import RetryError, TryAgain, retry, stop_after_attempt, stop_after_delay +from tenacity import ( + RetryError, + TryAgain, + retry, + stop_after_attempt, + stop_after_delay, + wait_fixed, +) from tinydb import TinyDB from tinydb.middlewares import CachingMiddleware from tinydb.storages import JSONStorage @@ -70,7 +77,7 @@ async def start(rss: rss_class.Rss) -> None: # 获取 RSS 并解析为 json ,失败重试 -@retry(stop=(stop_after_attempt(5) | stop_after_delay(30))) +@retry(wait=wait_fixed(1), stop=(stop_after_attempt(5) | stop_after_delay(30))) async def get_rss(rss: rss_class.Rss) -> dict: proxies = get_proxy(rss.img_proxy) # 对本机部署的 RSSHub 不使用代理 diff --git a/src/plugins/ELF_RSS2/show_dy.py b/src/plugins/ELF_RSS2/show_dy.py index 53726af9..59648ff3 100644 --- a/src/plugins/ELF_RSS2/show_dy.py +++ b/src/plugins/ELF_RSS2/show_dy.py @@ -28,7 +28,7 @@ async def handle_rss_list(rss_list: list) -> str: if rss_stopped_info_list: rss_stopped_info_list.sort() msg_str += ( - f"\n----------------------\n" + "\n----------------------\n" f"其中共有 {len(rss_stopped_info_list)} 条订阅已停止更新:\n\n" + "\n\n".join(rss_stopped_info_list) )