1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 16:13:18 +00:00
musix-oss/node_modules/simple-youtube-api/examples/playlist.js

14 lines
550 B
JavaScript
Raw Normal View History

2019-05-30 09:06:47 +00:00
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);