@distube/ytpl

Anonymous YouTube playlist resolver. Made for distube.js.org

Usage no npm install needed!

<script type="module">
  import distubeYtpl from 'https://cdn.skypack.dev/@distube/ytpl';
</script>

README

node-ytpl

NPM version NPM downloads codecov Known Vulnerabilities Discord

NPM info

Simple js only module to resolve YouTube playlist ids Doesn't need any login or GoogleAPI key

Forked from ytpl.

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

  • Example response

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