Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- videos = $$('.pl-video .timestamp');
- videos = videos.map(v => v.innerText);
- sum = 0;
- for(video of videos) {
- video = video.split(':');
- const videoTime = parseInt(video[1]) + (parseInt(video[0])*60);
- sum += videoTime;
- }
- std = Math.floor(sum / 3600);
- sum -= std * 3600;
- min = Math.floor(sum / 60);
- sum -= min * 60;
- s = sum;
- console.log(`${std}h ${min}m ${s}s`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement