【问题标题】:Php video upload to youtube via youtube data api通过 youtube 数据 api 将 PHP 视频上传到 youtube
【发布时间】:2015-02-12 10:33:54
【问题描述】:

我在上传视频到你的管子时遇到以下错误。

exception 'Google_ServiceException' with message 'Error calling POST
https://www.googleapis.com/upload/youtube/v3/videos?part=snippet%2Cstatus&uploadType=multipart&key=AIzaSyCfF7aL8R9qBbXTfl-TkdwcypMfWtPbtOI:
(403) 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.' in
/home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/google-api-php-client/src/io/Google_REST.php:66
Stack trace: #0
/home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/google-api-php-client/src/io/Google_REST.php(36):
Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1/home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/google-api-php-client/src/service/Google_ServiceResource.php(186):
Google_REST::execute(Object(Google_HttpRequest)) #2
/home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/google-api-php-client/src/contrib/Google_YouTubeService.php(887):
Google_ServiceResource->__call('insert', Array) #3 /home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/index.php(73):
Google_VideosServiceResource->insert('snippet,status',
Object(Google_Video), Array) #4 {main}

在谷歌开发者控制台下面的 api 被启用

BigQuery API        
Debuglet Controller API     
Google Cloud SQL            
Google Cloud Storage JSON API           
YouTube Analytics API           
YouTube Data API v3

应该启用哪个 api 来解决问题。

【问题讨论】:

    标签: php api youtube


    【解决方案1】:

    如果我们读到这个消息:

    在您的 API 上配置了 per-IP 或 per-Referer 限制 key 并且请求与这些限制不匹配。请使用 Google Developers Console 更新您的 API 密钥配置,如果 应允许来自此 IP 或引用者的请求。

    您没有将项目移动到另一个主机,或者您是否在另一个comp中工作,据我所知,google Api 提供了一个与您正在工作的主机相关的 api 密钥,所以在您的情况下,您必须去重新生成一个新的密钥!

    【讨论】:

    • 我只有同一个主机。
    • 所以你必须重新生成一个新密钥
    猜你喜欢
    • 1970-01-01
    • 2014-09-27
    • 2012-12-23
    • 2012-08-19
    • 2015-11-19
    • 1970-01-01
    • 2015-07-12
    • 2015-08-31
    • 2021-03-22
    相关资源
    最近更新 更多