Playlist thumbnail issue fixed
This commit is contained in:
parent
a6ae318b1d
commit
6280bf5b81
@ -281,7 +281,6 @@ interface PlaylistJSON {
|
|||||||
* YouTube Playlist thumbnail Data
|
* YouTube Playlist thumbnail Data
|
||||||
*/
|
*/
|
||||||
thumbnail?: {
|
thumbnail?: {
|
||||||
id: string | undefined;
|
|
||||||
width: number | undefined;
|
width: number | undefined;
|
||||||
height: number | undefined;
|
height: number | undefined;
|
||||||
url: string | undefined;
|
url: string | undefined;
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
export class YouTubeThumbnail {
|
export class YouTubeThumbnail {
|
||||||
id: string;
|
|
||||||
url: string;
|
url: string;
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
|
|
||||||
constructor(data: any) {
|
constructor(data: any) {
|
||||||
this.id = data.id;
|
|
||||||
this.url = data.url;
|
this.url = data.url;
|
||||||
this.width = data.width;
|
this.width = data.width;
|
||||||
this.height = data.height;
|
this.height = data.height;
|
||||||
@ -13,7 +11,6 @@ export class YouTubeThumbnail {
|
|||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return {
|
return {
|
||||||
id: this.id,
|
|
||||||
url: this.url,
|
url: this.url,
|
||||||
width: this.width,
|
width: this.width,
|
||||||
height: this.height
|
height: this.height
|
||||||
|
|||||||
@ -38,7 +38,6 @@ interface VideoOptions {
|
|||||||
* YouTube Thumbnail Data
|
* YouTube Thumbnail Data
|
||||||
*/
|
*/
|
||||||
thumbnail?: {
|
thumbnail?: {
|
||||||
id: string | undefined;
|
|
||||||
width: number | undefined;
|
width: number | undefined;
|
||||||
height: number | undefined;
|
height: number | undefined;
|
||||||
url: string | undefined;
|
url: string | undefined;
|
||||||
|
|||||||
@ -435,12 +435,7 @@ export function getPlaylistVideos(data: any, limit = Infinity): YouTubeVideo[] {
|
|||||||
index: parseInt(info.index?.simpleText) || 0,
|
index: parseInt(info.index?.simpleText) || 0,
|
||||||
duration: parseInt(info.lengthSeconds) || 0,
|
duration: parseInt(info.lengthSeconds) || 0,
|
||||||
duration_raw: info.lengthText?.simpleText ?? '0:00',
|
duration_raw: info.lengthText?.simpleText ?? '0:00',
|
||||||
thumbnail: {
|
thumbnails : info.thumbnail.thumbnails,
|
||||||
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
|
|
||||||
},
|
|
||||||
title: info.title.runs[0].text,
|
title: info.title.runs[0].text,
|
||||||
channel: {
|
channel: {
|
||||||
id: info.shortBylineText.runs[0].navigationEndpoint.browseEndpoint.browseId || undefined,
|
id: info.shortBylineText.runs[0].navigationEndpoint.browseEndpoint.browseId || undefined,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user