Skip to content

Commit

Permalink
修复订阅地址双斜杠错误 (#533)
Browse files Browse the repository at this point in the history
* 修复订阅地址双斜杠错误

* 补充注释
  • Loading branch information
kumiko-desu authored Sep 9, 2024
1 parent d6147fe commit 201ee58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/plugins/ELF_RSS2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .rss_class import Rss
from .utils import send_message_to_admin

VERSION = "2.6.23"
VERSION = "2.6.24"

__plugin_meta__ = PluginMetadata(
name="ELF_RSS",
Expand Down
7 changes: 2 additions & 5 deletions src/plugins/ELF_RSS2/rss_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ def __init__(self, data: Optional[Dict[str, Any]] = None):
def get_url(self, rsshub: str = str(config.rsshub)) -> str:
if URL(self.url).scheme in ["http", "https"]:
return self.url
# 先判断地址是否 / 开头
if self.url.startswith("/"):
return rsshub + self.url

return f"{rsshub}/{self.url}"
# 去除 rsshub地址末尾的斜杠 和 订阅地址开头的斜杠
return f"{rsshub.rstrip("/")}/{self.url.lstrip("/")}"

# 读取记录
@staticmethod
Expand Down

0 comments on commit 201ee58

Please sign in to comment.