distubejs / ytpl

Anonymous YouTube playlist resolver. Made for DisTube.js.org.
https://distube.js.org
MIT License
5 stars 2 forks source link

@distube/ytpl

A light-weight ytpl for DisTube. Original ytpl. Simple js only package to resolve YouTube Playlists. Does not require any login or Google-API-Key.

Installation

npm install @distube/ytpl

Usage

const ytpl = require("@distube/ytpl");

const playlist = await ytpl("https://www.youtube.com/playlist?list=PLRBp0Fe2GpglkzuspoGv-mu7B2ce9_0Fn");

API

ytpl(id, [options])

Attempts to resolve the given playlist id

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