【发布时间】:2019-09-14 23:03:06
【问题描述】:
我正在开展一个项目,该项目要求我获取 YouTube 直播聊天以在我的程序中使用。 this js 包一切正常,但谷歌似乎改变了一些东西,因为它突然停止工作。我已经重新生成了密钥,并且远低于我的配额,所以我知道这不是问题。
奇怪的是,当我在他们的在线文档中使用 youtube 数据 api "try this api" 部分时,在 id 找不到直播流的情况下也会发生同样的问题。我已经在许多不同的直播频道上尝试过,并且都返回了一个空的“项目”数组。其他人有这个问题吗?
function execute() {
return gapi.client.youtube.search.list({
"part": "snippet, id",
"channelId": "UCSJ4gkVC6NrvII8umztf0Ow",
"eventType": "live",
"type": "video"
})
.then(function(response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
},
function(err) { console.error("Execute error", err); });
}
请求的结果:
{
"kind": "youtube#searchListResponse",
"etag": "\"8jEFfXBrqiSrcF6Ee7MQuz8XuAM/4y-zlkAvKOyrH7TNQpxpBtYUxKU\"",
"regionCode": "US",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": []
}
【问题讨论】:
标签: api youtube stream items google-apis-explorer