fix: preserve absolute subtitle asset urls

This commit is contained in:
jxxghp
2026-06-10 01:02:09 +08:00
parent fa06d5d861
commit 4241461ba7
2 changed files with 4 additions and 0 deletions

View File

@@ -678,6 +678,9 @@ class SiteSpider:
"""
if not link:
return None
parsed_link = urlparse(link)
if parsed_link.scheme:
return link
if not link.startswith("http"):
if link.startswith("//"):
return self.domain.split(":")[0] + ":" + link

View File

@@ -396,6 +396,7 @@ def test_subtitle_site_spider_uses_direct_nexus_row(monkeypatch):
assert [item["title"] for item in result] == ["The.Capture.S01", "The.Capture.S02"]
assert result[0]["language"] == "添加时间"
assert result[0]["language_icon"] == "data:image/svg+xml;base64,xxx"
assert result[1]["language"] == "English"