get_live_chat
ウェブブラウザでライブチャットを表示する際に使用しているAPI.定期的に https://www.youtube.com/youtubei/v1/live_chat/get_live_chat に適切なパラメータを付与してPOSTすることで、擬似的にリアルタイムなチャットを得ている.Pollingなんやなぁ...そりゃそうか...という印象.
responseContext
continuationContents ←たまに無い時がある,分からん
liveChatContinuation
continuations
actions <Array<Object>>
addChatItemAction
item
liveChatTextMessageRenderer ←コメント
ここ
message
runs <Array<Object>>
text <String>
authorName
simpleText <String>
authorPhoto
thumbnails <Array<Object>>
url <String>
width <Number>
height <Number>
etc...
liveChatPaidMessageRenderer ←スパチャ
authorName
simpleText <String>
authorPhoto
thumbnails <Array<Object>>
purchaseAmountText
simpleText <String>
例) ¥930
message
runs <Array>
etc...
markChatItemAsDeletedAction ←コメントの削除
deletedStateMessage <Object>
code:example.js
{
markChatItemAsDeletedAction: {
deletedStateMessage: Object,
targetItemId: 'xxx'
}
},
{
liveChatPaidMessageRenderer: {
id: 'xxx',
timestampUsec: '1601477493693545',
authorName: { simpleText: 'ちくわ' },
authorPhoto: { thumbnails: Array },
purchaseAmountText: { simpleText: '¥930' },
message: { runs: Array },
headerBackgroundColor: 4278239141,
headerTextColor: 4278190080,
bodyBackgroundColor: 4280150454,
bodyTextColor: 4278190080,
authorExternalChannelId: 'xxx',
authorNameTextColor: 2315255808,
contextMenuEndpoint: {
clickTrackingParams: 'xxx',
commandMetadata: Object,
liveChatItemContextMenuEndpoint: Object
},
timestampColor: 2147483648,
contextMenuAccessibility: { accessibilityData: Object },
trackingParams: 'xxx'
}
}
#YouTube #Youtube_LiveChat