【问题标题】:exception 'Google_ServiceException' with message带有消息的异常“Google_ServiceException”
【发布时间】:2013-08-17 09:56:47
【问题描述】:

我收到如下错误。

exception 'Google_ServiceException' with message 'Error calling POST https://www.googleapis.com/upload/youtube/v3/videos?part=snippet%2Cstatus&uploadType=multipart: (401) Unauthorized' in D:\wamp\www\youtube\google-api-php-client\src\io\Google_REST.php:66 Stack trace: #0 D:\wamp\www\youtube\google-api-php-client\src\io\Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1 D:\wamp\www\youtube\google-api-php-client\src\service\Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest)) #2 D:\wamp\www\youtube\google-api-php-client\src\contrib\Google_YouTubeService.php(887): Google_ServiceResource->__call('insert', Array) #3 D:\wamp\www\youtube\index.php(67): Google_VideosServiceResource->insert('snippet,status', Object(Google_Video), Array) #4 {main}

我想制作一个脚本,用于在您的电子管上上传视频。我正在使用http://www.dreu.info/blog/uploading-a-video-to-youtube-through-api-version-3-in-php/ 这行代码。身份验证,一切正常,但不能上传视频。

【问题讨论】:

    标签: youtube youtube-api google-api-php-client


    【解决方案1】:

    您应该在 devconsole 的代码中设置您的客户端 ID 和密码。还要在该控制台中启用 Data API v3。

    【讨论】:

    • 是的,我已经设置了 setClientId、setClientSecret、setDeveloperKey 等,并且还启用了您的 tube api。此脚本在某些 gmail 帐户中有效,但有些无效。那么,这背后的原因是什么?
    猜你喜欢
    • 2012-12-03
    • 2012-10-06
    • 2013-02-01
    • 2014-08-08
    • 1970-01-01
    • 2016-02-27
    • 1970-01-01
    • 1970-01-01
    • 2011-07-16
    相关资源
    最近更新 更多