forked from deverzh/ai-api-proxy-list
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
40 lines (34 loc) · 910 Bytes
/
Copy pathupdate.sh
File metadata and controls
40 lines (34 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
echo "========================================"
echo " AI API 中转站列表 - 一键更新脚本"
echo " Mac / Linux 版本"
echo "========================================"
echo
cd "$(dirname "$0")"
echo "[1/3] 检查 Python 环境..."
if ! command -v python3 &> /dev/null; then
if ! command -v python &> /dev/null; then
echo "[错误] 未找到 Python,请先安装 Python 3.8+"
read -p "按 Enter 退出"
exit 1
else
PYTHON_CMD="python"
fi
else
PYTHON_CMD="python3"
fi
echo "[OK] Python 已安装"
echo
echo "[2/3] 发现 API Base URL 并测试延迟..."
$PYTHON_CMD discover_and_update.py --workers 15 --timeout 12
if [ $? -ne 0 ]; then
echo "[错误] 发现 API Base URL 失败"
read -p "按 Enter 退出"
exit 1
fi
echo
echo "[3/3] 更新完成!"
echo
echo "结果已保存到 README.md"
echo
read -p "按 Enter 退出"