Learn JavaScript by building a YouTube Playlist duration calculator

Опубликовано: 26 Февраль 2026
на канале: Kostas Minaidis
200
7

In this video we are going to learn the following:

Using JavaScript to calculate the total duration of a YouTube playlist by traversing the DOM nodes and doing some basic math operations.
Learn how to use a DevTools Snippet
Learn how to create a Bookmarklet
Learn how to create a Chrome Extension

Created by: Kostas Minaidis (@kostasx)

=====
Notes
=====

What got me confused while talking about the remainder operator,
is that in languages like Python, the % is actually the modulo operator
while in JavaScript it is the remainder operator. There pretty similar
but not exactly the same.

See this MDN page for more: https://developer.mozilla.org/en-US/d...

========================
References and resources
========================

The code can be found here:
https://github.com/in-tech-gration/WD...

How to enable Developer Mode in Chrome Extensions manager
https://support.google.com/chrome/thr...

Bookmarkleter: https://chriszarate.github.io/bookmar...

Get started with Chrome Extensions
https://developer.chrome.com/docs/ext...

Our Chrome Extension boilerplate:
https://github.com/GoogleChrome/chrom...

Download a single folder from a GitHub repository:
https://download-directory.github.io/...

Calculate YouTube playlist online:
https://www.lenostube.com/en/youtube-...
https://ytplaylist-len.sharats.dev/

Convert seconds to HH:MM:SS
https://www.inchcalculator.com/second...

For more ways to convert seconds into HH:MM:SS format, check out the answers on this StackOverflow thread: https://stackoverflow.com/questions/1...

About TrustedHTML: https://developer.mozilla.org/en-US/d...

The Playlists that I used for testing:

LLM Compendium
   • LLM Compendium  
MIT 6.006 Introduction to Algorithms, Spring 2020
   • MIT 6.006 Introduction to Algorithms, Spri...  
How AI Works
   • How AI Works  
Machine Learning for Web Developers (Web ML)
   • Machine Learning for Web Developers (Web ML)