youtubei 1.1.0 → 1.1.1
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.
|
@@ -44,7 +44,7 @@ class MusicSearchResultParser {
|
|
|
44
44
|
const [topColumn, bottomColumn] = item.flexColumns.map((c) => c.musicResponsiveListItemFlexColumnRenderer.text.runs);
|
|
45
45
|
const id = topColumn[0].navigationEndpoint.watchEndpoint.videoId;
|
|
46
46
|
const title = topColumn[0].text;
|
|
47
|
-
const duration = common_1.
|
|
47
|
+
const duration = common_1.getDuration(bottomColumn.at(-1).text) || undefined;
|
|
48
48
|
const thumbnails = new common_1.Thumbnails().load(item.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails);
|
|
49
49
|
const artists = MusicSearchResultParser.parseArtists(bottomColumn, client);
|
|
50
50
|
if (pageType === "MUSIC_VIDEO_TYPE_ATV") {
|
|
@@ -73,8 +73,14 @@ class BaseVideoParser {
|
|
|
73
73
|
}
|
|
74
74
|
static parseButtonRenderer(data) {
|
|
75
75
|
var _a;
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
let buttonRenderer;
|
|
77
|
+
if (!data.segmentedLikeDislikeButtonRenderer) {
|
|
78
|
+
buttonRenderer = data.toggleButtonRenderer || data.buttonRenderer;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
const likeButton = data.segmentedLikeDislikeButtonRenderer.likeButton;
|
|
82
|
+
buttonRenderer = likeButton.toggleButtonRenderer || likeButton.buttonRenderer;
|
|
83
|
+
}
|
|
78
84
|
const accessibilityData = (((_a = buttonRenderer.defaultText) === null || _a === void 0 ? void 0 : _a.accessibility) || buttonRenderer.accessibilityData).accessibilityData;
|
|
79
85
|
return accessibilityData.label;
|
|
80
86
|
}
|
|
@@ -14,7 +14,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
14
14
|
}
|
|
15
15
|
return ar;
|
|
16
16
|
};
|
|
17
|
-
import { stripToInt, Thumbnails } from "../../common";
|
|
17
|
+
import { getDuration, stripToInt, Thumbnails } from "../../common";
|
|
18
18
|
import { MusicAlbumCompact } from "../MusicAlbumCompact";
|
|
19
19
|
import { MusicArtistCompact } from "../MusicArtistCompact";
|
|
20
20
|
import { MusicBaseArtist } from "../MusicBaseArtist";
|
|
@@ -61,7 +61,7 @@ var MusicSearchResultParser = /** @class */ (function () {
|
|
|
61
61
|
var _a = __read(item.flexColumns.map(function (c) { return c.musicResponsiveListItemFlexColumnRenderer.text.runs; }), 2), topColumn = _a[0], bottomColumn = _a[1];
|
|
62
62
|
var id = topColumn[0].navigationEndpoint.watchEndpoint.videoId;
|
|
63
63
|
var title = topColumn[0].text;
|
|
64
|
-
var duration =
|
|
64
|
+
var duration = getDuration(bottomColumn.at(-1).text) || undefined;
|
|
65
65
|
var thumbnails = new Thumbnails().load(item.thumbnail.musicThumbnailRenderer.thumbnail.thumbnails);
|
|
66
66
|
var artists = MusicSearchResultParser.parseArtists(bottomColumn, client);
|
|
67
67
|
if (pageType === "MUSIC_VIDEO_TYPE_ATV") {
|
|
@@ -83,8 +83,14 @@ var BaseVideoParser = /** @class */ (function () {
|
|
|
83
83
|
};
|
|
84
84
|
BaseVideoParser.parseButtonRenderer = function (data) {
|
|
85
85
|
var _a;
|
|
86
|
-
var
|
|
87
|
-
|
|
86
|
+
var buttonRenderer;
|
|
87
|
+
if (!data.segmentedLikeDislikeButtonRenderer) {
|
|
88
|
+
buttonRenderer = data.toggleButtonRenderer || data.buttonRenderer;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
var likeButton = data.segmentedLikeDislikeButtonRenderer.likeButton;
|
|
92
|
+
buttonRenderer = likeButton.toggleButtonRenderer || likeButton.buttonRenderer;
|
|
93
|
+
}
|
|
88
94
|
var accessibilityData = (((_a = buttonRenderer.defaultText) === null || _a === void 0 ? void 0 : _a.accessibility) || buttonRenderer.accessibilityData).accessibilityData;
|
|
89
95
|
return accessibilityData.label;
|
|
90
96
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youtubei",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
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",
|