youtubei 1.8.2 → 1.8.3
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.
|
@@ -19,13 +19,33 @@ class BaseVideoParser {
|
|
|
19
19
|
target.thumbnails = new common_1.Thumbnails().load(videoInfo.videoDetails.thumbnail.thumbnails);
|
|
20
20
|
// Channel
|
|
21
21
|
const { title, thumbnail, subscriberCountText } = videoInfo.owner.videoOwnerRenderer;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
if (title) {
|
|
23
|
+
target.channel = new BaseChannel_1.BaseChannel({
|
|
24
|
+
client: target.client,
|
|
25
|
+
id: title.runs[0].navigationEndpoint.browseEndpoint.browseId,
|
|
26
|
+
name: title.runs[0].text,
|
|
27
|
+
subscriberCount: subscriberCountText === null || subscriberCountText === void 0 ? void 0 : subscriberCountText.simpleText,
|
|
28
|
+
thumbnails: new common_1.Thumbnails().load(thumbnail.thumbnails),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (videoInfo.owner.videoOwnerRenderer.attributedTitle) {
|
|
32
|
+
const channelsData = videoInfo.owner.videoOwnerRenderer.attributedTitle.commandRuns[0].onTap
|
|
33
|
+
.innertubeCommand.showDialogCommand.panelLoadingStrategy.inlineContent
|
|
34
|
+
.dialogViewModel.customContent.listViewModel.listItems;
|
|
35
|
+
const avatarsData = videoInfo.owner.videoOwnerRenderer.avatarStack.avatarStackViewModel.avatars;
|
|
36
|
+
target.channels = channelsData.map((c, i) => {
|
|
37
|
+
const viewModel = c.listItemViewModel;
|
|
38
|
+
const thumbnail = avatarsData[i].avatarViewModel.image.sources;
|
|
39
|
+
return new BaseChannel_1.BaseChannel({
|
|
40
|
+
client: target.client,
|
|
41
|
+
id: viewModel.title.commandRuns[0].onTap.innertubeCommand.browseEndpoint
|
|
42
|
+
.browseId,
|
|
43
|
+
name: viewModel.title.content,
|
|
44
|
+
subscriberCount: viewModel.subtitle.content,
|
|
45
|
+
thumbnails: new common_1.Thumbnails().load(thumbnail),
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
29
49
|
// Like Count and Dislike Count
|
|
30
50
|
const topLevelButtons = videoInfo.videoActions.menuRenderer.topLevelButtons;
|
|
31
51
|
target.likeCount = topLevelButtons
|
|
@@ -29,13 +29,33 @@ var BaseVideoParser = /** @class */ (function () {
|
|
|
29
29
|
target.thumbnails = new Thumbnails().load(videoInfo.videoDetails.thumbnail.thumbnails);
|
|
30
30
|
// Channel
|
|
31
31
|
var _e = videoInfo.owner.videoOwnerRenderer, title = _e.title, thumbnail = _e.thumbnail, subscriberCountText = _e.subscriberCountText;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
if (title) {
|
|
33
|
+
target.channel = new BaseChannel({
|
|
34
|
+
client: target.client,
|
|
35
|
+
id: title.runs[0].navigationEndpoint.browseEndpoint.browseId,
|
|
36
|
+
name: title.runs[0].text,
|
|
37
|
+
subscriberCount: subscriberCountText === null || subscriberCountText === void 0 ? void 0 : subscriberCountText.simpleText,
|
|
38
|
+
thumbnails: new Thumbnails().load(thumbnail.thumbnails),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (videoInfo.owner.videoOwnerRenderer.attributedTitle) {
|
|
42
|
+
var channelsData = videoInfo.owner.videoOwnerRenderer.attributedTitle.commandRuns[0].onTap
|
|
43
|
+
.innertubeCommand.showDialogCommand.panelLoadingStrategy.inlineContent
|
|
44
|
+
.dialogViewModel.customContent.listViewModel.listItems;
|
|
45
|
+
var avatarsData_1 = videoInfo.owner.videoOwnerRenderer.avatarStack.avatarStackViewModel.avatars;
|
|
46
|
+
target.channels = channelsData.map(function (c, i) {
|
|
47
|
+
var viewModel = c.listItemViewModel;
|
|
48
|
+
var thumbnail = avatarsData_1[i].avatarViewModel.image.sources;
|
|
49
|
+
return new BaseChannel({
|
|
50
|
+
client: target.client,
|
|
51
|
+
id: viewModel.title.commandRuns[0].onTap.innertubeCommand.browseEndpoint
|
|
52
|
+
.browseId,
|
|
53
|
+
name: viewModel.title.content,
|
|
54
|
+
subscriberCount: viewModel.subtitle.content,
|
|
55
|
+
thumbnails: new Thumbnails().load(thumbnail),
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
39
59
|
// Like Count and Dislike Count
|
|
40
60
|
var topLevelButtons = videoInfo.videoActions.menuRenderer.topLevelButtons;
|
|
41
61
|
target.likeCount = topLevelButtons
|
|
@@ -11,7 +11,7 @@ export interface BaseVideoProperties extends BaseProperties {
|
|
|
11
11
|
title?: string;
|
|
12
12
|
thumbnails?: Thumbnails;
|
|
13
13
|
description?: string;
|
|
14
|
-
channel?: BaseChannel;
|
|
14
|
+
channel?: BaseChannel | null;
|
|
15
15
|
uploadDate?: string;
|
|
16
16
|
viewCount?: number | null;
|
|
17
17
|
likeCount?: number | null;
|
|
@@ -28,7 +28,9 @@ export declare class BaseVideo extends Base implements BaseVideoProperties {
|
|
|
28
28
|
/** The description of this video */
|
|
29
29
|
description: string;
|
|
30
30
|
/** The channel that uploaded this video */
|
|
31
|
-
channel: BaseChannel;
|
|
31
|
+
channel: BaseChannel | null;
|
|
32
|
+
/** The collaborators of this video */
|
|
33
|
+
channels: BaseChannel[] | null;
|
|
32
34
|
/** The date this video is uploaded at */
|
|
33
35
|
uploadDate: string;
|
|
34
36
|
/** How many view does this video have, null if the view count is hidden */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youtubei",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.3",
|
|
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/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|