Skip to content

Instantly share code, notes, and snippets.

View cesarhilario's full-sized avatar
🎯
Focusing

César Hilário cesarhilario

🎯
Focusing
View GitHub Profile
@cesarhilario
cesarhilario / playlist_time.js
Last active November 21, 2023 14:31 — forked from fredericogg/playlist_time.js
Calcula o tempo total de uma playlist no Youtube. É só colar no console na página da playlist. Update para a nova interface do Youtube
(function () {
const timeContainer = document.querySelectorAll(
".ytd-thumbnail-overlay-time-status-renderer"
);
let timeSeconds = 0;
for (let i = 0; i < timeContainer.length; i++) {
const timeStr = timeContainer[i].innerText;
if (!/\d?\d:\d{2}(:\d{2})?/g.test(timeStr)) continue;
const timeParts = timeStr.split(":");