@ECHO OFF
COLOR 0A
:head
cls
TITLE 屏蔽Ku6、優酷、土豆、迅雷看看等在線視頻緩沖廣告
::ECHO 屏蔽Ku6、優酷、土豆、迅雷看看等在線視頻緩沖廣告
echo.&echo.
echo ┌───────::屏蔽視頻廣告::────────┐
echo │ │
echo │ 1.需要屏蔽視頻廣告(備份後改寫host文件) │
echo │ │
echo │ 2.不屏蔽視頻廣告(還原host文件) │
echo │ │
echo │ 3.處理視頻黑屏問題 │
echo │ │
echo │ 0.退出 │
echo │ │
echo └───────────────────────┘
echo.
set /p sel= 請輸入(1,2,3,0):
echo %sel%|findstr /be "[0-3]*" >nul &&goto:sta||(echo 輸入錯誤,請重新輸入&echo.&pause&goto:head)
:sta
if %sel%==1 set words=需要屏蔽視頻廣告&goto:backup
if %sel%==2 set words=不屏蔽視頻廣告&goto:recover
if %sel%==3 set words=處理視頻黑屏問題&goto:black
if %sel%==0 exit
echo 選擇了 %sel%,將設置為【words】
echo.&%0
:backup
TITLE 正在備份host文件
ECHO.&ECHO 正在備份host文件
if exist %windir%\system32\drivers\etc\hosts.bak (echo 備份文件已經存在,不進行備份) else (copy %windir%\system32\drivers\etc\hosts %windir%
\system32\drivers\etc\hosts.bak&if exist %windir%\system32\drivers\etc\hosts.bak echo 備份完成)
TITLE 正在完成屏蔽功能
ECHO.&ECHO 正在完成屏蔽功能
>>%windir%\system32\drivers\etc\hosts echo.
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 Fvid.atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 html.atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 valb.atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 valc.atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 valo.atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 valp.atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 valf.atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 lstat.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 speed.lstat.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 urchin.lstat.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 stat.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 static.lstat.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 vid.atm.youku.com
>>%windir%\system32\drivers\etc\hosts echo 127.0.0.1 walp.atm.youku.com
ipconfig /flushdns >nul
echo.
TITLE 屏蔽完成,請檢查是否成功
ECHO 屏蔽完成,請檢查是否成功
pause
goto:head
:recover
CLS
TITLE 不屏蔽廣告,還原host文件
ECHO.&ECHO 不屏蔽廣告,還原host文件
if exist %windir%\system32\drivers\etc\hosts.bak (copy /y %windir%\system32\drivers\etc\hosts.bak %windir%\system32\drivers\etc\hosts) else
(echo.&echo 備份文件不存在,無法還原)
ipconfig /flushdns >nul
ECHO.
pause
goto:head
:black
TITLE 處理視頻黑屏問題
ECHO 處理視頻黑屏問題
dir "%userprofile%\Application Data\Macromedia\Flash Player\#SharedObjects\" /ad/b >%SystemDrive%\DirTmp.txt
for /f %%a in (%SystemDrive%\DirTmp.txt) do rd /s /q "%userprofile%\Application Data\Macromedia\Flash Player\#SharedObjects\%%a"
md "%userprofile%\Application Data\Macromedia\Flash Player\#SharedObjects\static.youku.com"
attrib +a "%userprofile%\Application Data\Macromedia\Flash Player\#SharedObjects\static.youku.com"
del /f /q %SystemDrive%\DirTmp.txt
ECHO.&ECHO 操作完成!
pause
goto:head
:end
exit