优酷youku视频修改HOST去广告的批处理代码

第一种方法(直接修改HOST文件):

用记事本打开 %Systemroot%\system32\drivers\etc\hosts ,然后在里面填加下面的代码:

127.0.0.1 valb.atm.youku.com
127.0.0.1 valc.atm.youku.com
127.0.0.1 valf.atm.youku.com
127.0.0.1 valo.atm.youku.com
127.0.0.1 valp.atm.youku.com
127.0.0.1 vid.atm.youku.com
127.0.0.1 walp.atm.youku.com
127.0.0.1 static.atm.youku.com
127.0.0.1 atm.youku.com
127.0.0.1 stat.youku.com
127.0.0.1 static.lstat.youku.com

然后保存即可。

第二种方法(批处理修改HOST文件):

将下面的代码保存为 *.bat 格式的文件,如youku.bat,然后双击运行

@echo y|cacls "%Systemroot%\system32\drivers\etc\hosts" /e /p everyone:w
@echo.>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 valb.atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 valc.atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 valf.atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 valo.atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 valp.atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 vid.atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 walp.atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 static.atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 atm.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 stat.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 127.0.0.1 static.lstat.youku.com>>%Systemroot%\system32\drivers\etc\hosts
@echo 修改完毕,按任意键退出。
@pause > nul

第三种方法(修改路由器配置):

或者在路由器里面屏蔽 211.151.50.* 这个C段,可通过ping valo.atm.youku.com等获得。

Related Posts

2 thoughts on “优酷youku视频修改HOST去广告的批处理代码”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.