首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Youtube Live Streaming API使用限制

Youtube Live Streaming API使用限制
EN

Stack Overflow用户
提问于 2017-03-28 22:13:14
回答 1查看 1.4K关注 0票数 1

Youtube Live Streaming API有非常详尽的文档,我看过了文档和使用示例。最近我开始收到403错误。

错误的完整签名是:

代码语言:javascript
运行
复制
Error calling POST 

https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet%2Cstatus%2CcontentDetails: 

(403) Request is not authorized

我找不到背后的原因。刚开始的时候,只要有一个谷歌账户、凭据和OAuth密钥,一切都运行得很好。然后,在几个请求成功之后,它与403一起崩溃。使用了相同的凭据和密钥。

我坚信游戏中有一些限制,但这些限制是什么,或者如何绕过它们,我无法在文档或其他地方找到这些限制。

代码是这样的(直到断点):

代码语言:javascript
运行
复制
$liveStreamingApi = new LiveStreamingApi();
$youtube = $liveStreamingApi->setLiveBroadcasts($returnUrl, null, LiveStreamingApi::CREATE);

$broadcastSnippet = new \Google_Service_YouTube_LiveBroadcastSnippet();
$broadcastSnippet->setTitle($model->name);

$broadcastSnippet->setScheduledStartTime(STARTTIME);
$broadcastSnippet->setIsDefaultBroadcast('1');

$status = new \Google_Service_YouTube_LiveBroadcastStatus();
$status->setPrivacyStatus($privacy);

$broadcastInsert = new \Google_Service_YouTube_LiveBroadcast();
$broadcastInsert->setSnippet($broadcastSnippet);
$broadcastInsert->setStatus($status);
$broadcastInsert->setKind('youtube#liveBroadcast');

$broadcastsResponse = $youtube->liveBroadcasts->insert('snippet,status,contentDetails', $broadcastInsert, array());

其中$liveStreamingApi->setLiveBroadcast设置https中的所有基本作用域(force-ssl,youtube,youtubepartner) $youtube->liveBroadcasts>insert抛出上述错误

EN

回答 1

Stack Overflow用户

发布于 2017-03-29 15:06:34

youtube API上有一个配额限制,限制了您在一天内可以发出的请求。默认的配额值是每天1000000,全天拆分。但是,每次请求都会消耗不同数量的配额points.If,如果超过配额限制,则会得到一条错误消息,即insufficientLivePermissions。你可以在这里检查你的配额使用情况:https://developers.google.com/youtube/v3/determine_quota_cost,但是你可以认为一个插入请求花费了大约1600个配额。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43071939

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档