Simple package to resolve YouTube playlists - no strings attached.
npm install skt-ytplSimple js only package to resolve YouTube Playlists.
Does not require any login or Google-API-Key.
``js
const ytpl = require('ytpl');
const playlist = await ytpl('UU_aEa8K-EOJ3D6gOs7HcyNg');
`
Attempts to resolve the given playlist id
* idoptions
* id of the yt-playlist
* or a playlist url
* or a user url (resolves to uploaded playlist)
* or a channel url (resolves to uploaded playlist)
* US
* object with options
* possible settings:
* gl[String] -> 2-Digit Code of a Country, defaults to - Allows for localisation of the requesten
* hl[String] -> 2-Digit Code for a Language, defaults to - Allows for localisation of the request
* 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
* pages[Number] -> limits the pulled pages, pages contain 100 items, set to Infinity to get the whole playlist - numbers <1 result in the default limit being used - overwrites limit
* requestOptions[Object] -> Additional parameters to passed to miniget, which is used to do the https requests
* returns a Promise
* Example response
limitation.#### Usage
`js
const ytpl = require('ytpl');const firstResultBatch = await ytpl('UU_aEa8K-EOJ3D6gOs7HcyNg', { pages: 1 });
const secondResultBatch = ytpl.continueReq(firstResultBatch.continuation);
const thirdResultBatch = ytpl.continueReq(secondResultBatch.continuation);
// You can now use the .items property of all result batches e.g.:
console.log(firstResultBatch.items);
console.log(secondResultBatch.items);
console.log(thirdResultBatch.items);
`* returns a Promise resolving into
{ continuation, items }`Returns true if able to parse out a (formally) valid playlist ID.
Returns a playlist ID from a YouTube URL. Can be called with the playlist ID directly, in which case it just resolves.
* returns a promise resolving into a string containing the id
npm install --save ytpl