Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复订阅地址双斜杠错误 #533

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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