我目前正在尝试使用以下API调用来抓取我当前直播的聊天消息。
liveChatMessages().list(
part='id',
liveChatId=<my_livestream_id>,
)
chat_message_list = request.execute()
print(chat_message_list)
但是它返回以下错误:
{
"error": {
"code": 400,
"message": "page token is not valid.",
"errors": [
{
"message": "page token is not valid.",
"domain": "youtube.liveChat",
"reason": "pageTokenInvalid"
}
]
}
}
liveChatMessages中没有任何内容。列出有关此特定错误的文档。监控这个标签的谷歌工程师能解释一下这个问题吗?我现在正在直播,所以直播/聊天应该存在。
这可能有更多的原因,但在我的情况下,liveChatId
是错误的。我正在采取items[0].id
(其长度为11),但正确的值是在items[0].snippet.liveChatId
(长度为55)。