V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
cmichael
V2EX  ›  macOS

translate-shell 不能用, 404 错误了

  •  
  •   cmichael · 2022-10-24 01:15:25 +08:00 · 632 次点击
    这是一个创建于 543 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在 Terminal 输入 trans good ,返回: [ERROR] Google returned an error response. HTTP status code: 404 [ERROR] Other HTTP error

    用路由器梯子和 export 都试过,还是不行,以前都不用梯子都行的。。。

    9 条回复    2022-11-03 08:41:22 +08:00
    neiltroyer849
        1
    neiltroyer849  
       2022-10-24 02:02:36 +08:00 via iPad
    google 翻译不是不久前才宣布撤出中国了吗
    gesse
        2
    gesse  
       2022-10-24 08:14:00 +08:00
    现在国内的服务器是都不能用了吧

    以前还可以通过 hosts 文件来用。
    FanYD
        3
    FanYD  
       2022-10-24 09:46:08 +08:00
    之前不用梯子也可以,现在用梯子才行。export http_proxy=http://127.0.0.1:8001;export https_proxy=http://127.0.0.1:8001; 会影响 git 内网代码拉取。
    cmichael
        4
    cmichael  
    OP
       2022-10-24 13:15:06 +08:00
    @FanYD 我改的是 vi ~/.zshrc ,curl ipinfo.io 显示已经是到国外服务器了,但是 trans 还是 404 错误,你试过吗?
    FanYD
        5
    FanYD  
       2022-10-24 16:22:33 +08:00
    @cmichael 今天刚试的可以,我不 export ,curl ipinfo.io 也是显示国外服务器,你改完.zshrc 后 source 了吗?
    cmichael
        6
    cmichael  
    OP
       2022-10-31 23:16:00 +08:00
    @FanYD 我这样弄的,不行:
    $ vim ~/.zshrc
    # proxy
    proxy () {
    export http_proxy="http://127.0.0.1:60879"
    export https_proxy=$http_proxy
    export socks5_proxy="socks5://127.0.0.1:60879"
    echo "HTTP Proxy on"
    }

    # noproxy
    noproxy () {
    unset http_proxy
    unset https_proxy
    echo "HTTP Proxy off"
    }

    $ source ~/.zshrc
    FanYD
        7
    FanYD  
       2022-11-02 10:35:30 +08:00
    @cmichael echo $http_proxy 试一下,看看环境变量是否设置成功
    FanYD
        8
    FanYD  
       2022-11-02 10:36:29 +08:00
    @cmichael 我是这样设置的
    alias wpon='export http_proxy=http://127.0.0.1:8001;export https_proxy=http://127.0.0.1:8001;'
    alias wpoff='unset http_proxy;unset https_proxy;'
    cmichael
        9
    cmichael  
    OP
       2022-11-03 08:41:22 +08:00
    @FanYD 用了你的,echo $http_proxy 设置成功的,但是还是不行

    wpon 时:应该是正常能翻的,curl ipinfo.io 显示已经是到国外服务器了,但我用`trans good` 还是返回:
    [ERROR] Null response.
    [ERROR] Oops! Something went wrong and I can't translate it for you :(

    wpoff 时,返回:
    [ERROR] Google returned an error response. HTTP status code: 404
    [ERROR] Other HTTP error
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2767 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 12:09 · PVG 20:09 · LAX 05:09 · JFK 08:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.