all*_*ode 3 google-translate google-cloud-platform
我刚刚开始第一次使用 Google Translate API,但由于 403 Forbidden“超出用户速率限制”,我的请求被拒绝。这怎么可能??根据云控制台,我只生成了几个请求,但它们都是错误的。这是我获取该信息的屏幕截图:
另外,谷歌表示我的配额似乎没有被超出:
我似乎不可能超出 5 个请求中的任何报价。我怎样才能更好地理解为什么我会收到“超出用户速率限制”的消息,以及如何阻止这种情况发生?
据我所知,我使用的是默认配额。我从来没有能够成功地拨打电话(使用官方Python库)。后来我稍微减少了 funzies 的配额(默认值是允许的最大值),但这没有帮助。
这是我使用的确切代码:
>>> import six
>>> from google.cloud import translate_v2 as T
>>> c = T.Client()
>>> t = "The rain in Spain."
>>> r = c.translate(t, target_language='es')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/allyourcode/.local/lib/python2.7/site-packages/google/cloud/translate_v2/client.py", line 268, in translate
response = self._connection.api_request(method="POST", path="", data=data)
File "/home/allyourcode/.local/lib/python2.7/site-packages/google/cloud/_http.py", line 483, in api_request
raise exceptions.from_http_response(response)
google.api_core.exceptions.Forbidden: 403 POST https://translation.googleapis.com/language/translate/v2?prettyPrint=false: User Rate Limit Exceeded
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2684 次 |
| 最近记录: |