Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 访问Youtube数据API时ipRefererBlocked_Amazon Web Services_Youtube Api_Youtube Data Api - Fatal编程技术网

Amazon web services 访问Youtube数据API时ipRefererBlocked

Amazon web services 访问Youtube数据API时ipRefererBlocked,amazon-web-services,youtube-api,youtube-data-api,Amazon Web Services,Youtube Api,Youtube Data Api,截至昨天下午1点左右,我们无法再从AWS上的服务器使用Youtube数据API。我们现在收到来自云的每个请求的以下响应: curl "https://www.googleapis.com/youtube/v3/videos?id=GO5G-funzPI&key=OUR_API_KEY&part=contentDetails" { "error": { "errors": [ { "domain": "usageLimits", "reason": "i

截至昨天下午1点左右,我们无法再从AWS上的服务器使用Youtube数据API。我们现在收到来自云的每个请求的以下响应:

curl "https://www.googleapis.com/youtube/v3/videos?id=GO5G-funzPI&key=OUR_API_KEY&part=contentDetails"
{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "ipRefererBlocked",
    "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.",
    "extendedHelp": "https://console.developers.google.com"
   }
  ],
  "code": 403,
  "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."
 }
}
当我在开发者控制台中查看时,这个项目的API密钥没有IP地址限制。我们尝试在开发人员控制台中将外部IP和内部IP范围都列为白名单,但没有效果。白名单范围现已删除,但AWS内仍收到相同的消息

在AWS之外使用相同的API密钥时,不会收到此消息;如果我在家里或办公室网络上从我的机器上运行它,我会得到预期返回的视频数据:

curl "https://www.googleapis.com/youtube/v3/videos?id=GO5G-funzPI&key=OUR_API_KEY&part=contentDetails"
{
 "kind": "youtube#videoListResponse",
 "etag": "\"kuL0kDMAqRo3pU7O0pwlO-Lfzp4/Qye0F1aiqHjVYlPPicUgbMvEoOQ\"",
 "pageInfo": {
  "totalResults": 1,
  "resultsPerPage": 1
 },
 "items": [
  {
   "kind": "youtube#video",
   "etag": "\"kuL0kDMAqRo3pU7O0pwlO-Lfzp4/wMAduvfW4vn2Up8MEhRCbpCtY-w\"",
   "id": "GO5G-funzPI",
   "contentDetails": {
    "duration": "PT28S",
    "dimension": "2d",
    "definition": "sd",
    "caption": "true",
    "licensedContent": true
   }
  }
 ]
}

有什么想法吗?这是在我们的CMS后端运行的,用于在加载时从youtube视频中抓取标题、图像和描述。

您选择的API密钥类型可能不适合接收的流量。这似乎不是防火墙/通信问题,因为它提供了403错误,因此可以忽略。您能否为服务器生成一个新密钥,并查看这是否解决了该特定IP的问题


另请注意,最初为该项目创建的密钥类型是什么

无论你是否有足够的声誉,这都不是发表评论的正确方式。为此项目创建一个新密钥最终解决了问题。谢谢你,亚当!