youtube - 带消息的 'Google_ServiceException'异常

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

我收到如下错误。

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/这行代码。身份验证,一切正常,但不能上传视频。

最佳答案

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

关于youtube - 带消息的 'Google_ServiceException'异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18287477/

相关文章:

javascript - 使用jQuery每5秒更新一次YouTube观看直播的人数

android - 将 youtube 集成到 fragment

php - Youtube API - 从播放列表中获取视频的持续时间

java - youtube-mp3 头文件?

php - 使用 google-api-php-client 下载文件

google-api - 使用 Google API 时出现身份验证范围不足错误

php - 谷歌分析 API 关键字

javascript - 使用 document.write 编写 HTML 导致尝试嵌入 YouTube 时出错

iphone - 触摸(点击)事件的顺序

php - Youtube API限制注释