Bambooom

using google cloud python API via proxy

3 min read

想试用 google cloud 的 tts 服务, 跟着文档先把前期设置搞完了, credential 获取了, 安装了 python API (pip install google-cloud-texttospeech), 直接借用文档的 python 例子(python example.py)想试试效果, 结果死也出不来结果…

$ curl ip.cn
当前 IP:113.87.xxx.xx 来自:广东省深圳市 电信
$ export all_proxy=socks5://127.0.0.1:1087

当然是打开 shadowsocks 的情况下, 再试试

$ curl ip.cn
当前 IP:103.192.xxx.xx 来自:香港特别行政区 xTom

well, 这里终端情况下终于走了代理, 现在估计 brew update 之类的就会比较顺畅了

# 之前都写成了 socks5://127.0.0.1:1087
export http_proxy=http://127.0.0.1:1087
export https_proxy=http://127.0.0.1:1087

这下终于👌🏻了, python example.py 终于把 output.mp3 吐了出来✨

虽然把能用的方法试出来了, 并不知具体区别在哪里…求赐教😅