-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playlist support? #73
Labels
Comments
Feature Request ^ |
Closed
I agree, that feature would be awesome to have! |
Maybe better to use something like this https://github.com/tjrgg/simple-youtube-api/blob/master/examples/playlist.js EDIT: This works: const fs = require('fs');
const ytdl = require('ytdl-core');
const ytpl = require('ytpl');
const limit = 2;
const playlistId = 'UUht8qITGkBvXKsR1Byln-wA';
(async () => {
const playlist = await ytpl(playlistId);
const items = playlist.items.slice(0, limit);
console.log(items);
for (const { id, title, url } of items) {
console.log('Downloading', title);
const stream = ytdl(url).pipe(fs.createWriteStream(`${id}.mp4`));
await new Promise((resolve, reject) => {
stream.on('finish', resolve);
stream.on('error', reject);
});
}
})().catch(console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It'd be nice to have a playlist flag that would iterate over an API call to get all of the videos in a playlist and download them into the current directory.
The text was updated successfully, but these errors were encountered: