gypd
v1.0.4
Published
Get YouTube playlist duration
Downloads
1
Readme
Get YouTube playlist duration easily
Install:
npm i gypd
Import:
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
string
Your Google API key (with YouTube API v3 enabled). Watch this short video to learn how to generate your Google API keyplaylistId (required): type
string
The URL or id of the target YouTube playlistformatted (optional): type
boolean
, default valuefalse
Returns 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.