youtubei 0.0.1-rc.29 → 0.0.1-rc.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -65,19 +65,20 @@ class LiveVideo extends _1.BaseVideo {
|
|
|
65
65
|
const response = yield this.client.http.post(constants_1.LIVE_CHAT_END_POINT, {
|
|
66
66
|
data: { continuation: this.chatContinuation },
|
|
67
67
|
});
|
|
68
|
-
if (!response.continuationContents)
|
|
68
|
+
if (!response.data.continuationContents)
|
|
69
69
|
return;
|
|
70
70
|
this.parseChat(response.data);
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
this._timeoutMs =
|
|
74
|
-
this.chatContinuation =
|
|
71
|
+
const continuation = response.data.continuationContents.liveChatContinuation.continuations[0];
|
|
72
|
+
const continuationData = continuation.timedContinuation || continuation.invalidationContinuationData;
|
|
73
|
+
this._timeoutMs = continuationData.timeoutMs;
|
|
74
|
+
this.chatContinuation = continuationData.continuation;
|
|
75
75
|
this._chatRequestPoolingTimeout = setTimeout(() => this.pollChatContinuation(), this._timeoutMs);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
/** Parse chat data from Youtube and add to chatQueue */
|
|
79
79
|
parseChat(data) {
|
|
80
|
-
|
|
80
|
+
var _a;
|
|
81
|
+
const chats = ((_a = data.continuationContents.liveChatContinuation.actions) === null || _a === void 0 ? void 0 : _a.flatMap((a) => { var _a; return ((_a = a.addChatItemAction) === null || _a === void 0 ? void 0 : _a.item.liveChatTextMessageRenderer) || []; })) || [];
|
|
81
82
|
for (const rawChatData of chats) {
|
|
82
83
|
const chat = new _1.Chat({ client: this.client }).load(rawChatData);
|
|
83
84
|
if (this._chatQueue.find((c) => c.id === chat.id))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youtubei",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.31",
|
|
4
4
|
"description": "Simple package to get information from youtube such as videos, playlists, channels, video information & comments, related videos, up next video, and more!",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|