(hi=>{tm=chfour=>[chfour/3600
<<0,(chfour%3600)/60<<0||"00"
,Math.round(chfour%60)||"00"]
.filter(Boolean).map(chfour=>
chfour.toString().padStart(2,
"0")).join`:`;all=Array.from(
document.querySelectorAll`sp\
an.ytd-thumbnail-overlay-tim\
e-status-renderer`,eeeeeeee=>
eeeeeeee.innerText.split(":")
.reverse().map(a=>parseInt(a)
)).map(aa=>aa[0]+aa[1]*60+(aa
[2]||0)*3600);tot=all.reduce(
(a,b)=>a+b,10)-10;alert(`avg\
\u2000${tm(tot/all["length"])
}\nmax\u2000${tm(Math.max(...
all)<<0)}\nmin\u2000${tm(Math
.min(...all))}\ntotal\u2000${
tm(tot)}\n${all["length"]+1-1
}\u2000videos`);})("chfour");
/*https://chfour.github.io/*/
This is an obfuscated script that, when executed on the "Videos" page of a Youtube channel, will display:
- average video length,
- the duration of the longest video,
- the duration of the shortest video,
- video count.
The goal was not the lowest character count possible ("codegolfing"), but rather to obfuscate the code and make it "look nice". I just wanted to see if I could do it.
Important thing to note: you need to load all the videos. Holding [End] on your keyboard will work. Hold it until you reach the end of the page.
Below is the original script, a single-line version (single-line.js
), as well as a ready-made, URI-encoded bookmarklet (bookmarklet.txt
).