node-ytpl
Simple js only module to resolve YouTube playlist ids Doesn't need any login or GoogleAPI key
Support
You can contact us for support on our chat server
Usage
var ytpl = require('ytpl');
ytpl('UU_aEa8K-EOJ3D6gOs7HcyNg').then(playlist => {
dosth(playlist);
}).catch(err => {
console.error(err);
});
API
ytpl(id, [options])
Attempts to resolve the given playlist id
-
id
- id of the yt-playlist
- or playlist link
- or user link (resolves uploaded playlist)
- or channel link (resolves uploaded playlist)
-
options
- object with options
- possible settings:
- limit[Number] -> limits the pulled items, defaults to 100, set to Infinity to get the whole playlist - numbers <1 result in the default being used
- All additional parameters will get passed to miniget, which is used to do the https requests
-
returns a Promise
ytpl.validateID(string)
Returns true if able to parse out a (formally) valid playlist ID.
ytpl.getPlaylistID(string)
Returns a playlist ID from a YouTube URL. Can be called with the playlist ID directly, in which case it resolves.
Returns a promise.
Related / Works well with
Install
npm install --save ytpl
License
MIT