1.0.4 • Published 4 years ago
gypd v1.0.4
Get YouTube playlist duration easily
Install:
npm i gypdImport:
import gypd from "gypd"Use:
const duration = await gypd({
playlistId: PLAYLIST_ID_OR_URL,
apiKey: API_KEY,
formatted: true,
})Description:
gypd is is small package that returns YouTube playlist duration in seconds.
apiKey (required): type
stringYour Google API key (with YouTube API v3 enabled). Watch this short video to learn how to generate your Google API keyplaylistId (required): type
stringThe URL or id of the target YouTube playlistformatted (optional): type
boolean, default valuefalseReturns a duration object in the form of {days, hours, minutes and seconds}
Use try/catch block, or any equivalent solution to catch potential errors that might happen
If you face problems, open an issue, or contact me on Twitter @roktmy
Version 1 uploaded Sep 25, 2021, by Muhammad Yasser.