From 28fa5df61dccccc254caff8c7291408050d1c9a4 Mon Sep 17 00:00:00 2001 From: Flowseal Date: Sat, 18 Jul 2026 15:29:25 +0300 Subject: [PATCH] fixes #15952 --- service.bat | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/service.bat b/service.bat index 5b1606a..3a6f53a 100644 --- a/service.bat +++ b/service.bat @@ -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%"