feat(toolbox): 支持rar格式与7z格式解压,修改了下注释

这个提交包含在:
JasonGuo1
2023-03-30 15:45:58 +08:00
父节点 a360cd7e74
当前提交 e470ee1f7f
共有 2 个文件被更改,包括 3 次插入0 次删除

查看文件

@@ -14,6 +14,7 @@ if USE_PROXY:
# 代理网络的地址,打开你的科学上网软件查看代理的协议(socks5/http)、地址(localhost)和端口(11284)
proxies = { "http": "socks5h://localhost:11284", "https": "socks5h://localhost:11284", }
print('网络代理状态:运行。')
else:
proxies = None

查看文件

@@ -193,11 +193,13 @@ def extract_archive(file_path, dest_dir):
print("Successfully extracted rar archive to {}".format(dest_dir))
except:
print("rar格式需要安装额外依赖")
elif file_extension == '.7z':
try:
import py7zr
with py7zr.SevenZipFile(file_path, mode='r') as f:
f.extractall(path=dest_dir)
print("Successfully extracted 7z archive to {}".format(dest_dir))
except:
print("7z格式需要安装额外依赖")
else: