Update main.py
Browse files
main.py
CHANGED
|
@@ -17,23 +17,24 @@ import subprocess
|
|
| 17 |
|
| 18 |
def install_aria2():
|
| 19 |
try:
|
| 20 |
-
if 'ubuntu' in
|
| 21 |
-
|
| 22 |
-
elif 'centos' in
|
| 23 |
-
|
| 24 |
-
elif 'arch' in
|
| 25 |
-
|
| 26 |
-
elif 'darwin' in
|
| 27 |
-
|
| 28 |
else:
|
| 29 |
print("无法自动检测您的操作系统,请手动安装 aria2。")
|
| 30 |
-
except
|
| 31 |
print(f"安装 aria2 失败: {e}")
|
| 32 |
|
| 33 |
# 使用
|
| 34 |
install_aria2()
|
| 35 |
|
| 36 |
|
|
|
|
| 37 |
#SD插件下载
|
| 38 |
git_sd = [
|
| 39 |
'https://slink.ltd/https://github.com/2575044704/stable-diffusion-webui-localization-zh_CN2.git', #汉化
|
|
|
|
| 17 |
|
| 18 |
def install_aria2():
|
| 19 |
try:
|
| 20 |
+
if 'ubuntu' in os.popen('lsb_release -i').read().lower():
|
| 21 |
+
os.system('sudo apt-get install aria2 -y')
|
| 22 |
+
elif 'centos' in os.popen('cat /etc/redhat-release').read().lower():
|
| 23 |
+
os.system('sudo yum install aria2 -y')
|
| 24 |
+
elif 'arch' in os.popen('cat /etc/os-release').read().lower():
|
| 25 |
+
os.system('sudo pacman -S aria2')
|
| 26 |
+
elif 'darwin' in os.popen('uname').read().lower():
|
| 27 |
+
os.system('brew install aria2')
|
| 28 |
else:
|
| 29 |
print("无法自动检测您的操作系统,请手动安装 aria2。")
|
| 30 |
+
except Exception as e:
|
| 31 |
print(f"安装 aria2 失败: {e}")
|
| 32 |
|
| 33 |
# 使用
|
| 34 |
install_aria2()
|
| 35 |
|
| 36 |
|
| 37 |
+
|
| 38 |
#SD插件下载
|
| 39 |
git_sd = [
|
| 40 |
'https://slink.ltd/https://github.com/2575044704/stable-diffusion-webui-localization-zh_CN2.git', #汉化
|