gpt4 book ai didi

api - YouTube API无法从结束的广播事件中获取liveChatId

转载 作者:行者123 更新时间:2023-12-03 05:48:40 25 4
gpt4 key购买 nike

我正在尝试检索从实时流式传输中获得的所有聊天消息,该流式传输已经结束。但是使用下面的请求,它不会检索任何snippet.liveChatId,如Google文档中所述:https://developers.google.com/youtube/v3/live/docs/liveBroadcasts#snippet.liveChatId
如果我尝试即将进行的流式传输,则可以正常运行。
如果无法获得适当的liveChatId,在这种情况下如何获取聊天消息?
一些值替换为MY_XPTO
请求:

    GET https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet&id=MY_ID&key=[YOUR_API_KEY] HTTP/1.1

Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
响应:
    {
"kind": "youtube#liveBroadcastListResponse",
"etag": "MY_ETAG",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#liveBroadcast",
"etag": "MY_ETAG,
"id": "MY_ID",
"snippet": {
"publishedAt": "2020-04-03T21:23:06.000Z",
"channelId": "MY_CHANNEL_ID",
"title": "MY_TITLE",
"description": "MY_DESCRIPTION",
"thumbnails": {
"default": {
"url": "MYURL",
"width": 120,
"height": 90
},
"medium": {
"url": "MY_URL",
"width": 320,
"height": 180
},
"high": {
"url": "MY_URL",
"width": 480,
"height": 360
},
"standard": {
"url": "MY_URL",
"width": 640,
"height": 480
},
"maxres": {
"url": "MY_URL",
"width": 1280,
"height": 720
}
},
"scheduledStartTime": "2020-04-07T20:00:00.000Z",
"actualStartTime": "2020-04-07T20:01:00.326Z",
"actualEndTime": "2020-04-07T21:43:52.000Z",
"isDefaultBroadcast": false
}
}
]
}

最佳答案

The documentation指出:

string (return type)The ID of the currently active live chat attached to this video. This field is filled only if the video is a currently live broadcast that has live chat. Once the broadcast transitions to complete this field will be removed and the live chat closed down. For persistent broadcasts that live chat id will no longer be tied to this video but rather to the new video being displayed at the persistent page.


强调我的。
这意味着YouTube完成后会销毁 liveChatId(更确切地说,流结束后约400秒,或首映结束后约60秒),因此通过合法方式获取 liveChatId是不可能的。而且,即使您设法获得该ID,您也将无法使用该ID来修改以前的直播的聊天记录。

关于api - YouTube API无法从结束的广播事件中获取liveChatId,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61111699/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com