mirror of
https://github.com/Flowseal/zapret-discord-youtube.git
synced 2026-08-05 15:45:52 +03:00
fixes #15952
This commit is contained in:
@@ -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%"
|
||||
|
||||
Reference in New Issue
Block a user