DEV Community

Muhammad Yasser
Muhammad Yasser

Posted on

get YouTube playlist & media files duration easily

dur-cli is a CLI tool that helps you show total duration of media files on your computer, and also YouTube playlist duration.

first, install it using NPM:
npm i -g dur-cli
Enter fullscreen mode Exit fullscreen mode
second, cd into any folder and run:
dur
Enter fullscreen mode Exit fullscreen mode

view YouTube playlist duration:

dur --pl PLAYLIST_ID_OR_URL
Enter fullscreen mode Exit fullscreen mode

but first, have your own Google API key by following this very short tutorial here: https://youtu.be/Jl9Nitf8PJs

to view all options, type dur -h

For a live demo, watch this video https://youtu.be/JKXq7reTbAM

Try it and give your feedback. Have happy times!!

Source code: https://github.com/roktcode/duration-cli

Discussion (0)