youtubei 1.1.0 → 1.1.2
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.
- package/dist/cjs/music/MusicClient/MusicSearchResultParser.js +1 -1
- package/dist/cjs/youtube/BaseVideo/BaseVideoParser.js +8 -2
- package/dist/cjs/youtube/Playlist/PlaylistParser.js +1 -0
- package/dist/esm/music/MusicClient/MusicSearchResultParser.js +2 -2
- package/dist/esm/youtube/BaseVideo/BaseVideoParser.js +8 -2
- package/dist/esm/youtube/Playlist/PlaylistParser.js +1 -0
- package/dist/typings/youtube/Playlist/Playlist.d.ts +4 -1
- package/package.json +1 -1
|
@@ -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,6 +14,7 @@ class PlaylistParser {
|
|
|
14
14
|
target.id = (_a = Object.values(metadata)
|
|
15
15
|
.find((v) => v.includes("playlist?list="))) === null || _a === void 0 ? void 0 : _a.split("=")[1];
|
|
16
16
|
target.title = metadata.title;
|
|
17
|
+
target.thumbnails = new common_1.Thumbnails().load(primaryRenderer.thumbnailRenderer.playlistVideoThumbnailRenderer.thumbnail.thumbnails);
|
|
17
18
|
const { stats } = primaryRenderer;
|
|
18
19
|
if (primaryRenderer.stats.length === 3) {
|
|
19
20
|
target.videoCount = PlaylistParser.parseSideBarInfo(stats[0], true);
|
|
@@ -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
|
};
|
|
@@ -24,6 +24,7 @@ var PlaylistParser = /** @class */ (function () {
|
|
|
24
24
|
target.id = (_a = Object.values(metadata)
|
|
25
25
|
.find(function (v) { return v.includes("playlist?list="); })) === null || _a === void 0 ? void 0 : _a.split("=")[1];
|
|
26
26
|
target.title = metadata.title;
|
|
27
|
+
target.thumbnails = new Thumbnails().load(primaryRenderer.thumbnailRenderer.playlistVideoThumbnailRenderer.thumbnail.thumbnails);
|
|
27
28
|
var stats = primaryRenderer.stats;
|
|
28
29
|
if (primaryRenderer.stats.length === 3) {
|
|
29
30
|
target.videoCount = PlaylistParser.parseSideBarInfo(stats[0], true);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { YoutubeRawData } from "../../common";
|
|
1
|
+
import { Thumbnails, YoutubeRawData } from "../../common";
|
|
2
2
|
import { Base, BaseProperties } from "../Base";
|
|
3
3
|
import { BaseChannel, BaseChannelProperties } from "../BaseChannel";
|
|
4
4
|
import { PlaylistVideos } from "./PlaylistVideos";
|
|
@@ -9,6 +9,7 @@ interface PlaylistProperties extends BaseProperties {
|
|
|
9
9
|
videoCount?: number;
|
|
10
10
|
viewCount?: number;
|
|
11
11
|
lastUpdatedAt?: string;
|
|
12
|
+
thumbnails?: Thumbnails;
|
|
12
13
|
channel?: BaseChannelProperties;
|
|
13
14
|
videos?: PlaylistVideos;
|
|
14
15
|
}
|
|
@@ -23,6 +24,8 @@ export declare class Playlist extends Base implements PlaylistProperties {
|
|
|
23
24
|
viewCount: number;
|
|
24
25
|
/** Last time this playlist is updated */
|
|
25
26
|
lastUpdatedAt: string;
|
|
27
|
+
/** Thumbnails of this playlist */
|
|
28
|
+
thumbnails: Thumbnails;
|
|
26
29
|
/** The channel that made this playlist */
|
|
27
30
|
channel?: BaseChannel;
|
|
28
31
|
/** Continuable of videos in this playlist */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youtubei",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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",
|