mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-30 08:50:17 +08:00
fix cache
This commit is contained in:
@@ -16,11 +16,10 @@ from app.db.systemconfig_oper import SystemConfigOper
|
||||
from app.log import logger
|
||||
from app.schemas.types import MediaType, SystemConfigKey
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.singleton import WeakSingleton
|
||||
from app.utils.string import StringUtils
|
||||
|
||||
|
||||
class TorrentHelper(metaclass=WeakSingleton):
|
||||
class TorrentHelper:
|
||||
"""
|
||||
种子帮助类
|
||||
"""
|
||||
@@ -199,17 +198,14 @@ class TorrentHelper(metaclass=WeakSingleton):
|
||||
:param torrent_content: 种子内容
|
||||
:return: 文件夹名、文件清单,单文件种子返回空文件夹名
|
||||
"""
|
||||
|
||||
if not torrent_content:
|
||||
return "", []
|
||||
|
||||
|
||||
# 检查是否为磁力链接
|
||||
if isinstance(torrent_content, str) and torrent_content.startswith("magnet:"):
|
||||
# 磁力链接无法预先获取文件信息,返回空
|
||||
if StringUtils.is_magnet_link(torrent_content):
|
||||
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