Skip to content

Commit

Permalink
Merge pull request #262 from NekoAria/2.0
Browse files Browse the repository at this point in the history
🔖 发布 `v2.5.2`
  • Loading branch information
Quan666 authored Mar 4, 2022
2 parents c17a44e + 54947a5 commit ee14020
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ENVIRONMENT=prod
VERSION='v2.5.1'
VERSION='v2.5.2'
7 changes: 1 addition & 6 deletions docs/部署教程.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 机器人

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/ELF_RSS2/RSS/routes/Parsing/handle_html_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ async def handle_html_tag(html) -> str:
"strong",
"sub",
"table",
"tbody",
"td",
"th",
"thead",
"tr",
"u",
"ul",
Expand All @@ -137,7 +139,9 @@ async def handle_html_tag(html) -> str:
rss_str = re.sub(r"</?h\d>", "\n", rss_str)

# 删除图片、视频标签
rss_str = re.sub(r"<video[^>]*>(.*?</video>)?|<img[^>]+>", "", rss_str)
rss_str = re.sub(
r"<video[^>]*>(.*?</video>)?|<img[^>]+>", "", rss_str, flags=re.DOTALL
)

# 去掉多余换行
while "\n\n\n" in rss_str:
Expand Down
11 changes: 9 additions & 2 deletions src/plugins/ELF_RSS2/RSS/rss_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 不使用代理
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ELF_RSS2/show_dy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down

0 comments on commit ee14020

Please sign in to comment.