fix sites

This commit is contained in:
jxxghp
2023-06-11 11:25:50 +08:00
parent b889dd4939
commit 5334a408f2
5 changed files with 4 additions and 3 deletions

Binary file not shown.

View File

@ -35,14 +35,16 @@ class QbittorrentModule(_ModuleBase):
# 生成随机Tag # 生成随机Tag
tag = StringUtils.generate_random_str(10) tag = StringUtils.generate_random_str(10)
if settings.TORRENT_TAG: if settings.TORRENT_TAG:
tag = [tag, settings.TORRENT_TAG] tags = [tag, settings.TORRENT_TAG]
else:
tags = [tag]
# 如果要选择文件则先暂停 # 如果要选择文件则先暂停
is_paused = True if episodes else False is_paused = True if episodes else False
# 添加任务 # 添加任务
state = self.qbittorrent.add_torrent(content=torrent_path.read_bytes(), state = self.qbittorrent.add_torrent(content=torrent_path.read_bytes(),
download_dir=settings.DOWNLOAD_PATH, download_dir=settings.DOWNLOAD_PATH,
is_paused=is_paused, is_paused=is_paused,
tag=tag, tag=tags,
cookie=cookie) cookie=cookie)
if not state: if not state:
return None, f"添加种子任务失败:{torrent_path}" return None, f"添加种子任务失败:{torrent_path}"

View File

@ -119,4 +119,3 @@ class SystemUtils:
total_size += path.stat().st_size total_size += path.stat().st_size
return total_size return total_size