Skip to content

Instantly share code, notes, and snippets.

View Vaisakhkm2625's full-sized avatar

Vaisakh K M Vaisakhkm2625

  • <-- you don't need to know :)
View GitHub Profile
@Vaisakhkm2625
Vaisakhkm2625 / gist:c991b1490a20099125ec4b5660b125c3
Created March 8, 2023 12:15 — forked from liaohuqiu/gist:4ee77b9b03afcdecc80252252378d367
Find out the full duration time of a YouTube playlist
var list = document.getElementsByClassName('pl-video-time');
var time = 0;
function toS(hms) {
var a = hms.split(':');
while (a.length < 3) {
a.unshift(0);
}
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
return seconds;