Last active
January 8, 2018 13:51
-
-
Save egoing/11163965 to your computer and use it in GitHub Desktop.
Youtube에서 재생목록의 총재생시간을 알아내는 스크립트
This file contains 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
var times = document.querySelectorAll('.pl-video .pl-video-time .timestamp span'); | |
var duration = 0; | |
for(var i=0; i<times.length; i++){ | |
var t = times[i]; | |
t = t.innerText; | |
t = t.split(':') | |
min = t[0]; | |
sec = t[1]; | |
duration = duration + parseInt(sec) + parseInt(min)*60 | |
} | |
console.log(duration/60/60); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment