::[Bat To Exe Converter]
::
::YAwzoRdxOk+EWAjk
::fBw5plQjdCyDJGyX8VAjFDpQQQ2MNXiuFLQI5/rHy++UqVkSRN4MbY3P06CCJdQB60v3eZc50zoX2NsNHBpfcTyGWkE9qmEi
::YAwzuBVtJxjWCl3EqQJgSA==
::ZR4luwNxJguZRRnk
::Yhs/ulQjdF+5
::cxAkpRVqdFKZSDk=
::cBs/ulQjdF+5
::ZR41oxFsdFKZSDk=
::eBoioBt6dFKZSDk=
::cRo6pxp7LAbNWATEpCI=
::egkzugNsPRvcWATEpCI=
::dAsiuh18IRvcCxnZtBJQ
::cRYluBh/LU+EWAnk
::YxY4rhs+aU+JeA==
::cxY6rQJ7JhzQF1fEqQJQ
::ZQ05rAF9IBncCkqN+0xwdVs0
::ZQ05rAF9IAHYFVzEqQJQ
::eg0/rx1wNQPfEVWB+kM9LVsJDGQ=
::fBEirQZwNQPfEVWB+kM9LVsJDGQ=
::cRolqwZ3JBvQF1fEqQJQ
::dhA7uBVwLU+EWDk=
::YQ03rBFzNR3SWATElA==
::dhAmsQZ3MwfNWATElA==
::ZQ0/vhVqMQ3MEVWAtB9wSA==
::Zg8zqx1/OA3MEVWAtB9wSA==
::dhA7pRFwIByZRRnk
::Zh4grVQjdCyDJGyX8VAjFDpQQQ2MNXiuFLQI5/rHy++UqVkSRN48cJ3U17GJL2boPsMSpRL1OP+AbEz4xElk+Ol/6PnkIIuvMblLecKEtm8=
::YB416Ek+ZG8=
::
::
::978f952a14a936cc963da21a135fa983
@Echo Off
Title ip1云端更新 多配置文件下载
cd /d %~dp0

:: 确保子目录 json 存在
if not exist ".\json配置文件" md ".\json配置文件"

:: 第一组下载任务（版本1）
call :DownloadFile "Xray.json"       "xray"       "1"
call :DownloadFile "hysteria2.json"  "hysteria2"  "1"
call :DownloadFile "naiveproxy.json" "naiveproxy" "1"
call :DownloadFile "singbox.json"    "singbox"    "1"
call :DownloadFile "juicity.json"    "juicity"    "1"

:: 第二组下载任务（版本3）
call :DownloadFile "Xray-2.json"      "xray"      "3"
call :DownloadFile "hysteria2-2.json" "hysteria2" "3"

exit

:DownloadFile
set "filename=%~1"
set "folder=%~2"
set "version=%~3"
set "target=.\json配置文件\%filename%"

:: 清理旧文件
if exist "%target%" del "%target%"

:: 第一个源
wget -t 2 --no-check-certificate -O "%target%" "https://www.gitlabip.xyz/Alvin9999/PAC/master/backup/img/1/2/ipp/%folder%/%version%/config.json"

:: 校验大小
for %%F in ("%target%") do if %%~zF GEQ 100 goto :eof

:: 第二个源
wget -t 2 --no-check-certificate -O "%target%" "https://gitlab.com/free9999/ipupdate/-/raw/master/backup/img/1/2/ipp/%folder%/%version%/config.json"

:: 再次校验
for %%F in ("%target%") do if %%~zF GEQ 100 goto :eof

:: 下载失败提示（可选）
echo %filename% 下载失败，请检查链接或网络。
goto :eof
