youtube.liveChatMessages().insert
返回400
错误代码,原因是unexpectedPart
。
这与在Google API资源管理器中收到的响应相同。
def send_message(youtube):
send_message_response = youtube.liveChatMessages().insert (
part = "snippet",
body = dict (
snippet = dict(
liveChatId = result_chatId,
type = "textMessageEvent",
textMessageDetails = dict(
messageText = "hello world"
)
),
authorDetails = dict(
displayName = "blabla"
)
)
).execute()
print "%s" % (send_message_response)
Error response received.
最佳答案
我很确定authorDetails
资源是从API返回的字典,其中提供了有关聊天消息作者的详细信息。它仅从GET请求中返回,并且永远不能作为POST或PUT请求中的参数添加,因为该数据无法更改。
关于python - YouTube发送实时聊天消息不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36931319/