Last active
April 23, 2021 13:05
-
-
Save macmladen/ff40e7c36d05e365c53c5c2f44f0c7d1 to your computer and use it in GitHub Desktop.
When you are on YouTube playlist page and want to know how long will the list play. You can paste it in console and run to get time in hh:mm:ss.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const all = []; | |
document | |
.querySelectorAll('ytd-playlist-video-renderer ytd-thumbnail-overlay-time-status-renderer') | |
.forEach(a => all.push(a.textContent.trim())); | |
let videosLength = 0; | |
all.forEach(a => { | |
const timeSplit = a.split(':'); | |
videosLength += timeSplit[0]*60 + timeSplit[1]*1; | |
}) | |
console.log("Total list running time: " + new Date(videosLength * 1000).toISOString().substr(11, 8)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment