【发布时间】:2015-04-28 03:03:23
【问题描述】:
与此错误类似:Google YouTube API v3 iOS app key, 403 error code
除非在这种情况下,浏览器键不适用于 IOS 和 ANDROID 上的 HTTP 请求。
我在开发者控制台中创建了一个 Google 应用程序,打开了“YouTube Data API v3”,生成了浏览器 API 密钥,并将我的服务器添加为允许的引用。
当我像这样运行 HTTP 请求时:
https://www.googleapis.com/youtube/v3/videos?id=VIDEO_ID&key=API_KEY&part=snippet,contentDetails,statistics,status
这适用于桌面浏览器,但是当我在 IOS 或 Android 上尝试时,我收到错误消息:
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.
如果我去这里也是一样:
https://developers.google.com/youtube/youtube_player_demo
然后加载带有示例 id 的视频: F08U2yCxbYg ,点击“UPDATE PLAYER WITH SELECTED OPTIONS”
它适用于桌面浏览器,但不适用于 ios 和 android。
【问题讨论】:
标签: android ios youtube-api