youtubei 1.8.3 → 1.8.4
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.
|
@@ -6,21 +6,21 @@ const BaseVideo_1 = require("../BaseVideo");
|
|
|
6
6
|
const Comment_1 = require("../Comment");
|
|
7
7
|
class VideoParser {
|
|
8
8
|
static loadVideo(target, data) {
|
|
9
|
-
var _a, _b, _c, _d, _e;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
10
|
const videoInfo = BaseVideo_1.BaseVideoParser.parseRawData(data);
|
|
11
11
|
target.duration = +videoInfo.videoDetails.lengthSeconds;
|
|
12
12
|
const itemSectionRenderer = (_a = data.response.contents.twoColumnWatchNextResults.results.results.contents
|
|
13
13
|
.reverse()
|
|
14
14
|
.find((c) => c.itemSectionRenderer)) === null || _a === void 0 ? void 0 : _a.itemSectionRenderer;
|
|
15
15
|
target.comments.continuation = common_1.getContinuationFromItems((itemSectionRenderer === null || itemSectionRenderer === void 0 ? void 0 : itemSectionRenderer.contents) || []);
|
|
16
|
-
const chapters = (_c = (_b = data.response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer) === null || _b === void 0 ? void 0 : _b.decoratedPlayerBarRenderer.playerBar.multiMarkersPlayerBarRenderer.markersMap) === null ||
|
|
16
|
+
const chapters = (_d = (_c = (_b = data.response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer) === null || _b === void 0 ? void 0 : _b.decoratedPlayerBarRenderer.playerBar) === null || _c === void 0 ? void 0 : _c.multiMarkersPlayerBarRenderer.markersMap) === null || _d === void 0 ? void 0 : _d[0].value.chapters;
|
|
17
17
|
target.chapters =
|
|
18
18
|
(chapters === null || chapters === void 0 ? void 0 : chapters.map(({ chapterRenderer: c }) => ({
|
|
19
19
|
title: c.title.simpleText,
|
|
20
20
|
start: c.timeRangeStartMillis,
|
|
21
21
|
thumbnails: new common_1.Thumbnails().load(c.thumbnail.thumbnails),
|
|
22
22
|
}))) || [];
|
|
23
|
-
const musicPanel = (
|
|
23
|
+
const musicPanel = (_e = data.response.engagementPanels) === null || _e === void 0 ? void 0 : _e.find((e) => { var _a, _b; return (_b = (_a = e.engagementPanelSectionListRenderer.content) === null || _a === void 0 ? void 0 : _a.structuredDescriptionContentRenderer) === null || _b === void 0 ? void 0 : _b.items.find((i) => { var _a, _b; return ((_b = (_a = i.horizontalCardListRenderer) === null || _a === void 0 ? void 0 : _a.footerButton) === null || _b === void 0 ? void 0 : _b.buttonViewModel.iconName) === "MUSIC"; }); });
|
|
24
24
|
if (!musicPanel) {
|
|
25
25
|
target.music = null;
|
|
26
26
|
}
|
|
@@ -32,7 +32,7 @@ class VideoParser {
|
|
|
32
32
|
imageUrl: music.image.sources[0].url,
|
|
33
33
|
title: music.title,
|
|
34
34
|
artist: music.subtitle,
|
|
35
|
-
album: ((
|
|
35
|
+
album: ((_f = music.secondarySubtitle) === null || _f === void 0 ? void 0 : _f.content) || null,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
// target.music =
|
|
@@ -16,14 +16,14 @@ var VideoParser = /** @class */ (function () {
|
|
|
16
16
|
function VideoParser() {
|
|
17
17
|
}
|
|
18
18
|
VideoParser.loadVideo = function (target, data) {
|
|
19
|
-
var _a, _b, _c, _d, _e;
|
|
19
|
+
var _a, _b, _c, _d, _e, _f;
|
|
20
20
|
var videoInfo = BaseVideoParser.parseRawData(data);
|
|
21
21
|
target.duration = +videoInfo.videoDetails.lengthSeconds;
|
|
22
22
|
var itemSectionRenderer = (_a = data.response.contents.twoColumnWatchNextResults.results.results.contents
|
|
23
23
|
.reverse()
|
|
24
24
|
.find(function (c) { return c.itemSectionRenderer; })) === null || _a === void 0 ? void 0 : _a.itemSectionRenderer;
|
|
25
25
|
target.comments.continuation = getContinuationFromItems((itemSectionRenderer === null || itemSectionRenderer === void 0 ? void 0 : itemSectionRenderer.contents) || []);
|
|
26
|
-
var chapters = (_c = (_b = data.response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer) === null || _b === void 0 ? void 0 : _b.decoratedPlayerBarRenderer.playerBar.multiMarkersPlayerBarRenderer.markersMap) === null ||
|
|
26
|
+
var chapters = (_d = (_c = (_b = data.response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer) === null || _b === void 0 ? void 0 : _b.decoratedPlayerBarRenderer.playerBar) === null || _c === void 0 ? void 0 : _c.multiMarkersPlayerBarRenderer.markersMap) === null || _d === void 0 ? void 0 : _d[0].value.chapters;
|
|
27
27
|
target.chapters =
|
|
28
28
|
(chapters === null || chapters === void 0 ? void 0 : chapters.map(function (_a) {
|
|
29
29
|
var c = _a.chapterRenderer;
|
|
@@ -33,7 +33,7 @@ var VideoParser = /** @class */ (function () {
|
|
|
33
33
|
thumbnails: new Thumbnails().load(c.thumbnail.thumbnails),
|
|
34
34
|
});
|
|
35
35
|
})) || [];
|
|
36
|
-
var musicPanel = (
|
|
36
|
+
var musicPanel = (_e = data.response.engagementPanels) === null || _e === void 0 ? void 0 : _e.find(function (e) { var _a, _b; return (_b = (_a = e.engagementPanelSectionListRenderer.content) === null || _a === void 0 ? void 0 : _a.structuredDescriptionContentRenderer) === null || _b === void 0 ? void 0 : _b.items.find(function (i) { var _a, _b; return ((_b = (_a = i.horizontalCardListRenderer) === null || _a === void 0 ? void 0 : _a.footerButton) === null || _b === void 0 ? void 0 : _b.buttonViewModel.iconName) === "MUSIC"; }); });
|
|
37
37
|
if (!musicPanel) {
|
|
38
38
|
target.music = null;
|
|
39
39
|
}
|
|
@@ -45,7 +45,7 @@ var VideoParser = /** @class */ (function () {
|
|
|
45
45
|
imageUrl: music.image.sources[0].url,
|
|
46
46
|
title: music.title,
|
|
47
47
|
artist: music.subtitle,
|
|
48
|
-
album: ((
|
|
48
|
+
album: ((_f = music.secondarySubtitle) === null || _f === void 0 ? void 0 : _f.content) || null,
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
// target.music =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youtubei",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.4",
|
|
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",
|