Youtube Live Streaming API
有非常详尽的文档,我看过了文档和使用示例。最近我开始收到403错误。
错误的完整签名是:
Error calling POST
https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet%2Cstatus%2CcontentDetails:
(403) Request is not authorized
我找不到背后的原因。刚开始的时候,只要有一个谷歌账户、凭据和OAuth
密钥,一切都运行得很好。然后,在几个请求成功之后,它与403
一起崩溃。使用了相同的凭据和密钥。
我坚信游戏中有一些限制,但这些限制是什么,或者如何绕过它们,我无法在文档或其他地方找到这些限制。
代码是这样的(直到断点):
$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抛出上述错误
发布于 2017-03-29 15:06:34
youtube API上有一个配额限制,限制了您在一天内可以发出的请求。默认的配额值是每天1000000,全天拆分。但是,每次请求都会消耗不同数量的配额points.If,如果超过配额限制,则会得到一条错误消息,即insufficientLivePermissions。你可以在这里检查你的配额使用情况:https://developers.google.com/youtube/v3/determine_quota_cost,但是你可以认为一个插入请求花费了大约1600个配额。
https://stackoverflow.com/questions/43071939
复制相似问题