mirror of
https://github.com/Flowseal/zapret-discord-youtube.git
synced 2025-04-19 00:51:27 -07:00
Merge pull request #1512 from fridorin/main
This commit is contained in:
commit
99613c9423
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
version.txt
|
|
BIN
bin/winws.exe
BIN
bin/winws.exe
Binary file not shown.
@ -2,87 +2,36 @@
|
|||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
chcp 437 > nul
|
chcp 437 > nul
|
||||||
|
|
||||||
set "CURRENT_VERSION=1.6.3"
|
:: Set current version and URLs
|
||||||
set "GITHUB_URL=https://raw.githubusercontent.com/Flowseal/zapret-discord-youtube/refs/heads/main/.service/version.txt"
|
set "LOCAL_VERSION=1.6.3"
|
||||||
set "RELEASE_URL=https://github.com/Flowseal/zapret-discord-youtube/releases"
|
set "GITHUB_VERSION_URL=https://raw.githubusercontent.com/Flowseal/zapret-discord-youtube/main/.service/version.txt"
|
||||||
set "VERSION_FILE=version.txt"
|
set "GITHUB_RELEASE_URL=https://github.com/Flowseal/zapret-discord-youtube/releases/tag/"
|
||||||
set "SKIP_VERSION=null"
|
set "GITHUB_DOWNLOAD_URL=https://github.com/Flowseal/zapret-discord-youtube/releases/latest/download/zapret-discord-youtube-"
|
||||||
set "FILE_EXISTS=1"
|
|
||||||
|
|
||||||
for /f "delims=" %%A in ('powershell -command "[datetime]::Now.ToString('yyyy-MM-dd HH:mm:ss')"') do set CURRENT_TIMESTAMP=%%A
|
:: Get the latest version from GitHub
|
||||||
|
for /f "delims=" %%A in ('powershell -command "(Invoke-WebRequest -Uri \"%GITHUB_VERSION_URL%\" -Headers @{\"Cache-Control\"=\"no-cache\"} -TimeoutSec 5).Content.Trim()" 2^>nul') do set "GITHUB_VERSION=%%A"
|
||||||
|
|
||||||
:: If file version.txt exists
|
:: Error handling
|
||||||
if not exist %VERSION_FILE% (
|
if not defined GITHUB_VERSION (
|
||||||
set "FILE_EXISTS=0"
|
echo Error: Failed to fetch the latest version. Check your internet connection
|
||||||
echo time: %CURRENT_TIMESTAMP%> %VERSION_FILE%
|
|
||||||
echo ver: %CURRENT_VERSION%>> %VERSION_FILE%
|
|
||||||
)
|
|
||||||
|
|
||||||
:: Reading data from local version.txt
|
|
||||||
for /f "tokens=1,* delims=: " %%A in (%VERSION_FILE%) do (
|
|
||||||
if "%%A"=="time" set "LAST_CHECK=%%B"
|
|
||||||
if "%%A"=="ver" set "INSTALLED_VERSION=%%B"
|
|
||||||
if "%%A"=="skip" set "SKIP_VERSION=%%B"
|
|
||||||
)
|
|
||||||
|
|
||||||
:: If file was called from thirdparty script (with 'soft' argument that blocks checking for 12 hours)
|
|
||||||
if "%~1"=="soft" (
|
|
||||||
:: Converting dates to parts for calculation
|
|
||||||
for /f "tokens=1-6 delims=-: " %%A in ("%CURRENT_TIMESTAMP%") do (
|
|
||||||
set "CURRENT_MONTH=%%B"
|
|
||||||
set "CURRENT_DAY=%%C"
|
|
||||||
set "CURRENT_HOUR=%%D"
|
|
||||||
)
|
|
||||||
for /f "tokens=1-6 delims=-: " %%A in ("%LAST_CHECK%") do (
|
|
||||||
set "LAST_MONTH=%%B"
|
|
||||||
set "LAST_DAY=%%C"
|
|
||||||
set "LAST_HOUR=%%D"
|
|
||||||
)
|
|
||||||
|
|
||||||
set /a "time_diff_in_minutes = (CURRENT_MONTH - LAST_MONTH) * 43200 + (CURRENT_DAY - LAST_DAY) * 1440 + (CURRENT_HOUR - LAST_HOUR) * 60"
|
|
||||||
|
|
||||||
if !time_diff_in_minutes! LEQ 360 if !FILE_EXISTS!==1 (
|
|
||||||
echo Skipping the update check because it hasnt been 6 hours
|
|
||||||
goto :EOF
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
:: Reading new version from github
|
|
||||||
set "NEW_VERSION="
|
|
||||||
for /f "delims=" %%A in ('powershell -command "(Invoke-WebRequest -Uri %GITHUB_URL% -Headers @{\"Cache-Control\"=\"no-cache\"} -TimeoutSec 5).Content" 2^>nul') do set "NEW_VERSION=%%A"
|
|
||||||
if not defined NEW_VERSION (
|
|
||||||
echo Error reading new version
|
|
||||||
goto :EOF
|
goto :EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Rewrite file
|
:: Version comparison
|
||||||
echo time: %CURRENT_TIMESTAMP%> %VERSION_FILE%
|
if "%LOCAL_VERSION%"=="%GITHUB_VERSION%" (
|
||||||
echo ver: %INSTALLED_VERSION%>> %VERSION_FILE%
|
echo Latest version installed: %LOCAL_VERSION%
|
||||||
echo skip: %SKIP_VERSION%>> %VERSION_FILE%
|
|
||||||
|
|
||||||
:: Comparing versions
|
|
||||||
if "%NEW_VERSION%"=="%INSTALLED_VERSION%" (
|
|
||||||
echo You are using the latest version %NEW_VERSION%.
|
|
||||||
goto :EOF
|
|
||||||
) else (
|
) else (
|
||||||
:: Check if version skipped
|
echo New version available: %GITHUB_VERSION%
|
||||||
if "%NEW_VERSION%"=="%SKIP_VERSION%" (
|
echo Release page: %GITHUB_RELEASE_URL%%GITHUB_VERSION%
|
||||||
echo Newer version %NEW_VERSION% skipped by user.
|
|
||||||
goto :EOF
|
set /p "CHOICE=Do you want to automatically download the new version? (y/n, default: y): "
|
||||||
) else (
|
|
||||||
echo New version found: %NEW_VERSION%.
|
if "!CHOICE!"=="" set "CHOICE=y"
|
||||||
echo Visit %RELEASE_URL% to download a new version
|
|
||||||
|
if /i "!CHOICE!"=="y" (
|
||||||
|
echo Opening the download page...
|
||||||
|
start "" "%GITHUB_DOWNLOAD_URL%%GITHUB_VERSION%.zip"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if not "%1"=="soft" pause
|
||||||
:: Skip check
|
|
||||||
set /p "CHOICE=Skip this update? (y/n, default: n): " || set "CHOICE=n"
|
|
||||||
set "CHOICE=!CHOICE:~0,1!"
|
|
||||||
if /i "!CHOICE!"=="y" (
|
|
||||||
echo skip: %NEW_VERSION%>> %VERSION_FILE%
|
|
||||||
echo Update %NEW_VERSION% skipped.
|
|
||||||
) else (
|
|
||||||
start %RELEASE_URL%
|
|
||||||
)
|
|
||||||
|
|
||||||
endlocal
|
endlocal
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
:: NOT RECOMMENDED
|
:: NOT RECOMMENDED
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
@ -1,19 +1,25 @@
|
|||||||
discord.com
|
|
||||||
gateway.discord.gg
|
|
||||||
cdn.discordapp.com
|
|
||||||
discordapp.net
|
|
||||||
discordapp.com
|
|
||||||
discord.gg
|
|
||||||
media.discordapp.net
|
|
||||||
images-ext-1.discordapp.net
|
|
||||||
discord.app
|
|
||||||
discord.media
|
|
||||||
discordcdn.com
|
|
||||||
discord.dev
|
|
||||||
discord.new
|
|
||||||
discord.gift
|
|
||||||
discordstatus.com
|
|
||||||
dis.gd
|
|
||||||
discord.co
|
|
||||||
discord-attachments-uploads-prd.storage.googleapis.com
|
|
||||||
cloudflare-ech.com
|
cloudflare-ech.com
|
||||||
|
dis.gd
|
||||||
|
discord-attachments-uploads-prd.storage.googleapis.com
|
||||||
|
discord.app
|
||||||
|
discord.co
|
||||||
|
discord.com
|
||||||
|
discord.design
|
||||||
|
discord.dev
|
||||||
|
discord.gift
|
||||||
|
discord.gifts
|
||||||
|
discord.gg
|
||||||
|
discord.media
|
||||||
|
discord.new
|
||||||
|
discord.status
|
||||||
|
discord.store
|
||||||
|
discordapp.com
|
||||||
|
discordapp.net
|
||||||
|
discordcdn.com
|
||||||
|
discordmerch.com
|
||||||
|
discordpartygames.com
|
||||||
|
discordsays.com
|
||||||
|
discordsez.com
|
||||||
|
discord-activities.com
|
||||||
|
discordactivities.com
|
||||||
|
stable.dl2.discordapp.net
|
||||||
|
@ -1,36 +1,42 @@
|
|||||||
googlevideo.com
|
10tv.app
|
||||||
youtu.be
|
|
||||||
youtube.com
|
|
||||||
youtubei.googleapis.com
|
|
||||||
youtubeembeddedplayer.googleapis.com
|
|
||||||
ytimg.l.google.com
|
|
||||||
ytimg.com
|
|
||||||
jnn-pa.googleapis.com
|
|
||||||
youtube-nocookie.com
|
|
||||||
youtube-ui.l.google.com
|
|
||||||
yt-video-upload.l.google.com
|
|
||||||
wide-youtube.l.google.com
|
|
||||||
youtubekids.com
|
|
||||||
ggpht.com
|
|
||||||
discord.com
|
|
||||||
gateway.discord.gg
|
|
||||||
cdn.discordapp.com
|
|
||||||
discordapp.net
|
|
||||||
discordapp.com
|
|
||||||
discord.gg
|
|
||||||
media.discordapp.net
|
|
||||||
images-ext-1.discordapp.net
|
|
||||||
discord.app
|
|
||||||
discord.media
|
|
||||||
discordcdn.com
|
|
||||||
discord.dev
|
|
||||||
discord.new
|
|
||||||
discord.gift
|
|
||||||
discordstatus.com
|
|
||||||
dis.gd
|
|
||||||
discord.co
|
|
||||||
discord-attachments-uploads-prd.storage.googleapis.com
|
|
||||||
7tv.app
|
7tv.app
|
||||||
7tv.io
|
7tv.io
|
||||||
10tv.app
|
|
||||||
cloudflare-ech.com
|
cloudflare-ech.com
|
||||||
|
dis.gd
|
||||||
|
discord-attachments-uploads-prd.storage.googleapis.com
|
||||||
|
discord.app
|
||||||
|
discord.co
|
||||||
|
discord.com
|
||||||
|
discord.design
|
||||||
|
discord.dev
|
||||||
|
discord.gift
|
||||||
|
discord.gifts
|
||||||
|
discord.gg
|
||||||
|
discord.media
|
||||||
|
discord.new
|
||||||
|
discord.store
|
||||||
|
discord.status
|
||||||
|
discord-activities.com
|
||||||
|
discordactivities.com
|
||||||
|
discordapp.com
|
||||||
|
discordapp.net
|
||||||
|
discordcdn.com
|
||||||
|
discordmerch.com
|
||||||
|
discordpartygames.com
|
||||||
|
discordsays.com
|
||||||
|
discordsez.com
|
||||||
|
ggpht.com
|
||||||
|
googlevideo.com
|
||||||
|
jnn-pa.googleapis.com
|
||||||
|
stable.dl2.discordapp.net
|
||||||
|
wide-youtube.l.google.com
|
||||||
|
youtube-nocookie.com
|
||||||
|
youtube-ui.l.google.com
|
||||||
|
youtube.com
|
||||||
|
youtubeembeddedplayer.googleapis.com
|
||||||
|
youtubekids.com
|
||||||
|
youtubei.googleapis.com
|
||||||
|
youtu.be
|
||||||
|
yt-video-upload.l.google.com
|
||||||
|
ytimg.com
|
||||||
|
ytimg.l.google.com
|
||||||
|
@ -1,23 +1,27 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
set "arg=%1"
|
:: Admin rights check
|
||||||
if "%arg%" == "admin" (
|
if "%1"=="admin" (
|
||||||
echo Restarted with admin rights
|
echo Started with admin rights
|
||||||
) else (
|
) else (
|
||||||
|
echo Requesting admin rights...
|
||||||
powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/k \"\"%~f0\" admin\"' -Verb RunAs"
|
powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/k \"\"%~f0\" admin\"' -Verb RunAs"
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
|
:: Main
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
set BIN_PATH=%~dp0bin\
|
||||||
|
|
||||||
|
:: Checking for updates
|
||||||
call check_updates.bat soft
|
call check_updates.bat soft
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
set BIN_PATH=%~dp0bin\
|
|
||||||
|
|
||||||
:: Searching for .bat files in current folder, except files that start with "service"
|
:: Searching for .bat files in current folder, except files that start with "service"
|
||||||
|
echo Pick one of the options:
|
||||||
set "count=0"
|
set "count=0"
|
||||||
for %%f in (*.bat) do (
|
for %%f in (*.bat) do (
|
||||||
set "filename=%%~nxf"
|
set "filename=%%~nxf"
|
||||||
@ -31,12 +35,11 @@ for %%f in (*.bat) do (
|
|||||||
:: Choosing file
|
:: Choosing file
|
||||||
set "choice="
|
set "choice="
|
||||||
set /p "choice=Input file index (number): "
|
set /p "choice=Input file index (number): "
|
||||||
|
|
||||||
if "!choice!"=="" goto :eof
|
if "!choice!"=="" goto :eof
|
||||||
|
|
||||||
set "selectedFile=!file%choice%!"
|
set "selectedFile=!file%choice%!"
|
||||||
if not defined selectedFile (
|
if not defined selectedFile (
|
||||||
echo Wrong choice, exiting..
|
echo Wrong choice, exiting...
|
||||||
pause
|
pause
|
||||||
goto :eof
|
goto :eof
|
||||||
)
|
)
|
||||||
@ -107,11 +110,13 @@ for /f "tokens=*" %%a in ('type "!selectedFile!"') do (
|
|||||||
:: Creating service with parsed args
|
:: Creating service with parsed args
|
||||||
set ARGS=%args%
|
set ARGS=%args%
|
||||||
echo Final args: !ARGS!
|
echo Final args: !ARGS!
|
||||||
|
|
||||||
set SRVCNAME=zapret
|
set SRVCNAME=zapret
|
||||||
|
|
||||||
net stop %SRVCNAME%
|
net stop %SRVCNAME% >nul 2>&1
|
||||||
sc delete %SRVCNAME%
|
sc delete %SRVCNAME% >nul 2>&1
|
||||||
sc create %SRVCNAME% binPath= "\"%BIN_PATH%winws.exe\" %ARGS%" DisplayName= "zapret" start= auto
|
sc create %SRVCNAME% binPath= "\"%BIN_PATH%winws.exe\" %ARGS%" DisplayName= "zapret" start= auto
|
||||||
sc description %SRVCNAME% "zapret DPI bypass software"
|
sc description %SRVCNAME% "Zapret DPI bypass software"
|
||||||
sc start %SRVCNAME%
|
sc start %SRVCNAME%
|
||||||
|
|
||||||
|
pause
|
||||||
|
endlocal
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
:: 65001 - UTF-8
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
set "arg=%1"
|
if "%1"=="admin" (
|
||||||
if "%arg%" == "admin" (
|
echo Started with admin rights
|
||||||
echo Restarted with admin rights
|
|
||||||
) else (
|
) else (
|
||||||
|
echo Requesting admin rights...
|
||||||
powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/k \"\"%~f0\" admin\"' -Verb RunAs"
|
powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/k \"\"%~f0\" admin\"' -Verb RunAs"
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@ -19,3 +19,6 @@ net stop "WinDivert"
|
|||||||
sc delete "WinDivert"
|
sc delete "WinDivert"
|
||||||
net stop "WinDivert14"
|
net stop "WinDivert14"
|
||||||
sc delete "WinDivert14"
|
sc delete "WinDivert14"
|
||||||
|
|
||||||
|
pause
|
||||||
|
endlocal
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 > nul
|
||||||
|
:: 65001 - UTF-8
|
||||||
|
|
||||||
if "%~1"=="" (
|
if "%~1"=="" (
|
||||||
call :test_service zapret
|
call :test_service zapret
|
||||||
|
Loading…
Reference in New Issue
Block a user