mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
Handle magnet links in torrent parsing and downloader modules (#4815)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: jxxghp <jxxghp@live.cn>
This commit is contained in:
@@ -201,6 +201,15 @@ class TorrentHelper(metaclass=WeakSingleton):
|
||||
"""
|
||||
if not torrent_content:
|
||||
return "", []
|
||||
|
||||
# 检查是否为磁力链接
|
||||
if isinstance(torrent_content, str) and torrent_content.startswith("magnet:"):
|
||||
# 磁力链接无法预先获取文件信息,返回空
|
||||
return "", []
|
||||
elif isinstance(torrent_content, bytes) and torrent_content.startswith(b"magnet:"):
|
||||
# 磁力链接无法预先获取文件信息,返回空
|
||||
return "", []
|
||||
|
||||
try:
|
||||
# 解析种子内容
|
||||
torrentinfo = Torrent.from_string(torrent_content)
|
||||
|
||||
Reference in New Issue
Block a user