Playlist thumbnail issue fixed

This commit is contained in:
killer069 2021-12-09 09:19:20 +05:30
parent a6ae318b1d
commit 6280bf5b81
4 changed files with 1 additions and 11 deletions

View File

@ -281,7 +281,6 @@ interface PlaylistJSON {
* YouTube Playlist thumbnail Data
*/
thumbnail?: {
id: string | undefined;
width: number | undefined;
height: number | undefined;
url: string | undefined;

View File

@ -1,11 +1,9 @@
export class YouTubeThumbnail {
id: string;
url: string;
width: number;
height: number;
constructor(data: any) {
this.id = data.id;
this.url = data.url;
this.width = data.width;
this.height = data.height;
@ -13,7 +11,6 @@ export class YouTubeThumbnail {
toJSON() {
return {
id: this.id,
url: this.url,
width: this.width,
height: this.height

View File

@ -38,7 +38,6 @@ interface VideoOptions {
* YouTube Thumbnail Data
*/
thumbnail?: {
id: string | undefined;
width: number | undefined;
height: number | undefined;
url: string | undefined;

View File

@ -435,12 +435,7 @@ export function getPlaylistVideos(data: any, limit = Infinity): YouTubeVideo[] {
index: parseInt(info.index?.simpleText) || 0,
duration: parseInt(info.lengthSeconds) || 0,
duration_raw: info.lengthText?.simpleText ?? '0:00',
thumbnail: {
id: info.videoId,
url: info.thumbnail.thumbnails[info.thumbnail.thumbnails.length - 1].url,
height: info.thumbnail.thumbnails[info.thumbnail.thumbnails.length - 1].height,
width: info.thumbnail.thumbnails[info.thumbnail.thumbnails.length - 1].width
},
thumbnails : info.thumbnail.thumbnails,
title: info.title.runs[0].text,
channel: {
id: info.shortBylineText.runs[0].navigationEndpoint.browseEndpoint.browseId || undefined,