【问题标题】:Youtube Request gets blockedYoutube 请求被阻止
【发布时间】:2015-07-04 04:32:03
【问题描述】:

我想使用我创建的 Android Youtube API 谷歌控制台中的 API 密钥并将其添加到我的项目中。 现在,当我执行 Youtube 查询时,我收到以下消息:

04-25 16:41:05.899: W/System.err(7213): com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
04-25 16:41:05.900: W/System.err(7213): {
04-25 16:41:05.900: W/System.err(7213):   "code" : 403,
04-25 16:41:05.900: W/System.err(7213):   "errors" : [ {
04-25 16:41:05.900: W/System.err(7213):     "domain" : "usageLimits",
04-25 16:41:05.900: W/System.err(7213):     "message" : "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.",
04-25 16:41:05.900: W/System.err(7213):     "reason" : "ipRefererBlocked",
04-25 16:41:05.900: W/System.err(7213):     "extendedHelp" : "https://console.developers.google.com"
04-25 16:41:05.900: W/System.err(7213):   } ],
04-25 16:41:05.900: W/System.err(7213):   "message" : "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed."
04-25 16:41:05.900: W/System.err(7213): }

我还需要做什么才能让谷歌不阻止我的请求?请求 每个用户的限制是每天 3000 个,我用了 0 个。

【问题讨论】:

  • 这可能是一个愚蠢的问题,但您确实将您的原始 IP 添加到开发人员控制台中的 API 密钥中,对吗?错误消息不是配额消息,而是关于访问控制的。如果您通过某种代理运行,也可能发生这种情况。

标签: android youtube-api android-youtube-api


【解决方案1】:

在您的 Google 开发人员仪表板中,点击凭据,查看您的 API 密钥是由引荐来源还是由 IP 设置的。如果它受到限制,请确保它与您的推荐人或 IP 匹配。

【讨论】:

  • 你知道如何在新的谷歌开发者控制台网页界面中检查这个功能吗???
  • 1.登录console.developers.google.com/project?pli=1 2. 单击您的项目。 3. 单击启用的 API 选项卡。 4. 单击 YouTube 数据 API v3。 5. 单击左窗格中的凭据。 6. 在右窗格中单击要查看的凭据。
  • 您是否使用了新界面,谷歌控制台已更改。在新功能中,没有这个功能,或者我可能遗漏了一些东西。
  • 我刚刚在 6 分钟前检查过,这些是在新界面中采取的步骤。
  • 我想为 Android 创建一个简单的密钥,但它没有显示推荐人。仅显示 API 密钥、激活数据、激活者...,但不显示引用者。
猜你喜欢
  • 1970-01-01
  • 2019-11-04
  • 2017-02-06
  • 1970-01-01
  • 2021-06-26
  • 2018-10-18
  • 2021-01-05
相关资源
最近更新 更多