Merge remote-tracking branch 'origin/wlj0807' into wlj0807

This commit is contained in:
mayun110 2023-08-09 09:34:33 +08:00
commit d8e0a1cf0b
3 changed files with 21 additions and 8 deletions

View File

@ -36,7 +36,7 @@ class DownloadChain(ChainBase):
if meta.resource_term: if meta.resource_term:
msg_text = f"{msg_text}\n质量:{meta.resource_term}" msg_text = f"{msg_text}\n质量:{meta.resource_term}"
if torrent.size: if torrent.size:
if str(torrent.size).isdigit(): if str(torrent.size).replace(".", "").isdigit():
size = StringUtils.str_filesize(torrent.size) size = StringUtils.str_filesize(torrent.size)
else: else:
size = torrent.size size = torrent.size

View File

@ -57,10 +57,10 @@ class SubtitleModule(_ModuleBase):
if download_dir.exists(): if download_dir.exists():
break break
time.sleep(1) time.sleep(1)
# 不是目录说明是单文件种子,直接使用下载目录 # 目录不存在则创建目录
if not download_dir.exists(): if not download_dir.exists():
logger.error(f"字幕下载位置不存在:{download_dir}") download_dir.mkdir(parents=True, exist_ok=True)
return # 不是目录说明是单文件种子,直接使用下载目录
if download_dir.is_file(): if download_dir.is_file():
download_dir = download_dir.parent download_dir = download_dir.parent
# 读取网站代码 # 读取网站代码
@ -91,9 +91,6 @@ class SubtitleModule(_ModuleBase):
# 下载 # 下载
ret = request.get_res(sublink) ret = request.get_res(sublink)
if ret and ret.status_code == 200: if ret and ret.status_code == 200:
# 创建目录
if not download_dir.exists():
download_dir.mkdir(parents=True, exist_ok=True)
# 保存ZIP # 保存ZIP
file_name = TorrentHelper.get_url_filename(ret, sublink) file_name = TorrentHelper.get_url_filename(ret, sublink)
if not file_name: if not file_name:

View File

@ -367,6 +367,22 @@ class TorrentRemover(_PluginBase):
} }
] ]
}, },
{
'component': 'VCol',
'props': {
'cols': 6
},
'content': [
{
'component': 'VTextField',
'props': {
'model': 'errorkeywords',
'label': '错误信息关键词',
'placeholder': '支持正式表达式'
}
}
]
},
{ {
'component': 'VCol', 'component': 'VCol',
'props': { 'props': {
@ -457,7 +473,7 @@ class TorrentRemover(_PluginBase):
] ]
} }
], { ], {
"enable": False, "enabled": False,
"notify": False, "notify": False,
"onlyonce": False, "onlyonce": False,
"action": 'pause', "action": 'pause',