Skip to content

Instantly share code, notes, and snippets.

View omargoda's full-sized avatar
🏠
Working from home

Omar G. Goda omargoda

🏠
Working from home
View GitHub Profile
@omargoda
omargoda / gist:6c22db35554a2cf8082ae2e200ccd593
Last active September 8, 2021 17:26 — forked from liaohuqiu/gist:4ee77b9b03afcdecc80252252378d367
Find out the full duration time of a YouTube playlist
var list = document.getElementsByClassName('ytd-thumbnail-overlay-time-status-renderer');
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;