1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 09:53:17 +00:00
musix-oss/node_modules/simple-youtube-api/examples/playlist.js
MatteZ02 5eb0264906 fix
2019-05-30 12:06:47 +03:00

14 lines
550 B
JavaScript

const YouTube = require('simple-youtube-api');
const youtube = new YouTube(' Y o u r A p i K e y ');
youtube.getPlaylist('https://www.youtube.com/playlist?list=PL2BN1Zd8U_MsyMeK8r9Vdv1lnQGtoJaSa')
.then(playlist => {
console.log(`The playlist's title is ${playlist.title}`);
playlist.getVideos()
.then(videos => {
console.log(`This playlist has ${videos.length === 50 ? '50+' : videos.length} videos.`);
})
.catch(console.log);
})
.catch(console.log);