Closed udit2303 closed 3 years ago
.getPlaylist() returns null if tried to get playlist via the URL. This however works fine with the playlist id. Here's an example:
.getPlaylist()
null
const youtube = require('youtube-sr'); const playlist = await youtube.getPlaylist("https://www.youtube.com/playlist?list=PLYT4vq6pQVSu743ULpyGUVZTZtWMUKIXf"); console.log(playlist);
will return null, how ever
const youtube = require('youtube-sr'); const playlist = await youtube.getPlaylist("PLYT4vq6pQVSu743ULpyGUVZTZtWMUKIXf"); console.log(playlist)
would return
Playlist { id: 'PLYT4vq6pQVSu743ULpyGUVZTZtWMUKIXf', title: "It's Game Time", videoCount: 33, lastUpdate: 'Last updated on ', views: 241541, url: 'https://www.youtube.com/playlist?list=PLYT4vq6pQVSu743ULpyGUVZTZtWMUKIXf', link: 'https://www.youtube.com/watch?v=Oj18EikZMuU&list=PLYT4vq6pQVSu743ULpyGUVZTZtWMUKIXf', channel: { name: 'Alan Walker', id: 'UCJrOtniJ0-NWz37R30urifQ', url: 'https://www.youtube.com/channel/UCJrOtniJ0-NWz37R30urifQ', icon: 'https://yt3.ggpht.com/ytc/AAUvwnjsfDHGvv6gR8hvxLhCFyekPe1PK1DyFX4BU1WBOA=s176-c-k-c0x00ffffff-no-rj-mo' }, thumbnail: 'https://i.ytimg.com/vi/Oj18EikZMuU/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLCDnCfSLZuXsu8jaaQQrQcgF1sxMg', videos: [ Video { id: 'Oj18EikZMuU', title: 'K-391, Alan Walker & Ahrix - End of Time (Official Video)', description: null, durationFormatted: '3:06', duration: 186000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'UtF6Jej8yb4', title: 'Avicii - The Nights', description: null, durationFormatted: '3:11', duration: 191000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: '60ItHLz5WEA', title: 'Alan Walker - Faded', description: null, durationFormatted: '3:33', duration: 213000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'uOFTqVi-qp4', title: 'San Holo - Light (Official Video)', description: null, durationFormatted: '3:56', duration: 236000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'eEKfWVvADiQ', title: 'Legends Never Die: Remix (ft. Alan Walker) | Worlds 2017 - League of Legends', description: null, durationFormatted: '2:47', duration: 167000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: '3Q9rewnLFYw', title: "Flux Pavilion - I Can't Stop", description: null, durationFormatted: '2:28', duration: 148000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'wJnBTPUQS5A', title: 'Alan Walker - The Spectre', description: null, durationFormatted: '3:27', duration: 207000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'iYKXdt0LRs8', title: 'Travis Scott - The Plan (From the Motion Picture "TENET" - Official Audio)', description: null, durationFormatted: '3:08', duration: 188000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'lqYQXIt4SpA', title: 'Alan Walker - Force', description: null, durationFormatted: '4:00', duration: 240000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'abYP-NPLTbw', title: 'Elektronomia - Breeze [NCS Release]', description: null, durationFormatted: '3:41', duration: 221000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: '1DCiUhNn9rc', title: 'Au/Ra, Alan Walker - Ghost (Official Video)', description: null, durationFormatted: '3:21', duration: 201000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'o3WdLtpWM_c', title: 'FISHER - Losing It', description: null, durationFormatted: '6:41', duration: 401000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'fwUqWgHMlyo', title: 'Alan Walker & Alex Skrindo - Sky', description: null, durationFormatted: '3:33', duration: 213000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'q1ULJ92aldE', title: 'Syn Cole - Feel Good [NCS Release]', description: null, durationFormatted: '3:02', duration: 182000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'dhYOPzcsbGM', title: 'Alan Walker, Sabrina Carpenter & Farruko - On My Way', description: null, durationFormatted: '3:37', duration: 217000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: '25N1pdzvp4c', title: 'K-391 - Summertime [Sunshine]', description: null, durationFormatted: '4:43', duration: 283000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'aw_cfy1P8f8', title: 'Alan Walker x A$AP Rocky - Live Fast (PUBGM) | Lyric Video', description: null, durationFormatted: '3:53', duration: 233000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: '0s3o1kXlxzo', title: 'VIZE & Tom Gregory - Never Let Me Down (Official Video HD)', description: null, durationFormatted: '2:49', duration: 169000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'YQRHrco73g4', title: "Alan Walker, K-391, Tungevaag, Mangoo - PLAY (Alan Walker's Video)", description: null, durationFormatted: '3:14', duration: 194000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: '4655JKMpABA', title: 'Jonas Blue, RetroVision - All Night Long (Visualiser)', description: null, durationFormatted: '3:29', duration: 209000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'axRAL0BXNvw', title: 'Hans Zimmer & Alan Walker – Time (Official Remix)', description: null, durationFormatted: '3:32', duration: 212000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'uPLMgp7XmiU', title: 'Whethan - Savage (feat. Flux Pavilion & MAX)', description: null, durationFormatted: '3:30', duration: 210000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'Az-mGR-CehY', title: 'K-391 & Alan Walker - Ignite (feat. Julie Bergan & Seungri)', description: null, durationFormatted: '3:50', duration: 230000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'HOH55FRo4m8', title: 'MARSHMELLO x SLUSHII - PUT YO HANDS UP', description: null, durationFormatted: '3:18', duration: 198000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'Wrgp3Rp1kPY', title: 'Steve Aoki & Alan Walker - Are You Lonely feat. ISÁK (Official Video) [Ultra Music]', description: null, durationFormatted: '3:02', duration: 182000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'TW9d8vYrVFQ', title: 'Elektronomia - Sky High [NCS Release]', description: null, durationFormatted: '3:58', duration: 238000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'Mw9U7FPaZho', title: 'Alan Walker x David Whistle - Routine', description: null, durationFormatted: '2:47', duration: 167000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'IIrCDAV3EgI', title: 'Tobu - Candyland [NCS Release]', description: null, durationFormatted: '3:19', duration: 199000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'TtMTGL2G-Ck', title: 'Alan Walker - Avem (The Aviation Theme)', description: null, durationFormatted: '3:47', duration: 227000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'uS2tlYnEVeE', title: 'VIZE, Felix Jaehn - Thank You [Not So Bad] (Official Audio)', description: null, durationFormatted: '3:20', duration: 200000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'dOo2jWb73JY', title: 'K-391 - Earth [NCS Release]', description: null, durationFormatted: '3:54', duration: 234000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'QHVREB6fdvI', title: 'Slushii - All I Need [Rocket League Intro Song]', description: null, durationFormatted: '3:46', duration: 226000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] }, Video { id: 'wa6Xz6tk_XI', title: 'NEW: Alan Walker x Alex Skrindo - Sky VIP (Remix)', description: null, durationFormatted: '4:04', duration: 244000, uploadedAt: null, views: 0, thumbnail: [Thumbnail], channel: [Channel] } ] }
Fixed 😃 https://github.com/DevSnowflake/youtube-sr/releases/tag/v2.0.0
.getPlaylist()
returnsnull
if tried to get playlist via the URL. This however works fine with the playlist id. Here's an example:will return null, how ever
would return