This commit is contained in:
Flowseal
2026-07-18 15:29:25 +03:00
parent 0e7c839089
commit 28fa5df61d

View File

@@ -928,18 +928,20 @@ set "hostsUrl=https://raw.githubusercontent.com/Flowseal/zapret-discord-youtube/
set "tempFile=%TEMP%\zapret_hosts.txt"
set "needsUpdate=0"
set "cacheBuster=%RANDOM%%RANDOM%%RANDOM%"
set "requestUrl=%hostsUrl%?t=%cacheBuster%"
echo Checking hosts file...
if exist "%SystemRoot%\System32\curl.exe" (
curl -L -s -o "%tempFile%" "%hostsUrl%"
curl -L -s --fail -o "%tempFile%" "%requestUrl%"
) else (
powershell -NoProfile -Command ^
"$url = '%hostsUrl%';" ^
"$url = '%requestUrl%';" ^
"$out = '%tempFile%';" ^
"$res = Invoke-WebRequest -Uri $url -TimeoutSec 10 -UseBasicParsing;" ^
"if ($res.StatusCode -eq 200) { $res.Content | Out-File -FilePath $out -Encoding UTF8 } else { exit 1 }"
)
if not exist "%tempFile%" (
call :PrintRed "Failed to download hosts file from repository"
call :PrintYellow "Copy hosts file manually from %hostsUrl%"