Skip to content

Commit 201ee58

Browse files
authored
修复订阅地址双斜杠错误 (#533)
* 修复订阅地址双斜杠错误 * 补充注释
1 parent d6147fe commit 201ee58

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/plugins/ELF_RSS2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from .rss_class import Rss
1515
from .utils import send_message_to_admin
1616

17-
VERSION = "2.6.23"
17+
VERSION = "2.6.24"
1818

1919
__plugin_meta__ = PluginMetadata(
2020
name="ELF_RSS",

src/plugins/ELF_RSS2/rss_class.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,8 @@ def __init__(self, data: Optional[Dict[str, Any]] = None):
4949
def get_url(self, rsshub: str = str(config.rsshub)) -> str:
5050
if URL(self.url).scheme in ["http", "https"]:
5151
return self.url
52-
# 先判断地址是否 / 开头
53-
if self.url.startswith("/"):
54-
return rsshub + self.url
55-
56-
return f"{rsshub}/{self.url}"
52+
# 去除 rsshub地址末尾的斜杠 和 订阅地址开头的斜杠
53+
return f"{rsshub.rstrip("/")}/{self.url.lstrip("/")}"
5754

5855
# 读取记录
5956
@staticmethod

0 commit comments

Comments
 (0)