Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube에서 재생목록의 총재생시간을 알아내는 스크립트
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
You can’t perform that action at this time.