google翻译停用后大家用什么 只要一步轻松解决
视频教程:
需要把代码复制下来,创建一个txt文件,把文件拓展名改为bat,右键管理员运行脚本,待结束后,刷新页面谷歌翻译就能正常使用了,截止到2022年10月25日,这个脚本现在还是能用的。
@setlocal enabledelayedexpansion
@echo off
set "source_domain=google.cn"
set "target_domain=translate.googleapis.com"
set "hosts_file=C:\Windows\System32\drivers\etc\hosts"
::for /f "skip=4 tokens=2" %%a in ('"nslookup %source_domain% 2>NUL"') do set ip=%%a
set "ip=172.253.124.90"
set "old_rule=null"
set "new_rule=%ip% %target_domain%"
for /f "tokens=*" %%i in ('type %hosts_file%') do (
set "line=%%i"
:: Retrieve the rule If the target domain has been exists in the line.
if not "!line:%target_domain%=!"=="%%i" set "old_rule=%%i"
)
if not "%old_rule%"=="null" (
if not "%old_rule%"=="%new_rule%" (
echo Deleting the rule "%old_rule%"
echo Adding the rule "%new_rule%"
for /f "tokens=*" %%i in ('type "%hosts_file%" ^| find /v /n "" ^& break ^> "%hosts_file%"') do (
set "rule=%%i"
set "rule=!rule:*]=!"
if "%old_rule%"=="!rule!" set "rule=%new_rule%"
>>%hosts_file% echo(!rule!
)
) else (
echo The rule already exists, nothing to do.
)
) else (
echo Adding the rule "%new_rule%"
echo.>>%hosts_file%
echo.>>%hosts_file%
echo # Fix Google Translate CN>>%hosts_file%
echo %new_rule%>>%hosts_file%
)
@ipconfig /flushdns
@echo "修改谷歌翻译和刷新dns完成,请关闭!"
echo Done.
pause
更多内容可以搜索 欧气社区
,免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com