Last active
March 18, 2022 12:56
-
-
Save apricot13/0d8f0ea32138e2d36e6f5ff3de00254b to your computer and use it in GitHub Desktop.
Highlight short videos on youtube (bookmarklet)
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
javascript:const milliseconds=(e,t,r)=>1e3*(60*e*60+60*t+r),times=document.querySelectorAll("ytd-thumbnail-overlay-time-status-renderer");[...times].forEach(e=>{const t=e.querySelector("#text").innerHTML.trim().split(":");2===t.length&&t.unshift("0");const r=milliseconds(t[0],t[1],t[2]);r<=6e4&&(e.closest("ytd-grid-video-renderer").style.backgroundColor="#a57070"),isNaN(r)&&(e.closest("ytd-grid-video-renderer").style.backgroundColor="#6e6ebb")}); |
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
javascript:const milliseconds=(e,t,s)=>1e3*(60*e*60+60*t+s),times=document.querySelectorAll("ytd-thumbnail-overlay-time-status-renderer");[...times].forEach(e=>{const t=e.querySelector("#text").innerHTML.trim().split(":");2===t.length&&t.unshift("0");const s=milliseconds(t[0],t[1],t[2]);s<=6e4&&(e.closest("ytd-grid-video-renderer").style.display="none"),isNaN(s)&&(e.closest("ytd-grid-video-renderer").style.display="none")}); |
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
javascript:const milliseconds=(e,t,s)=>1e3*(60*e*60+60*t+s),times=document.querySelectorAll("ytd-thumbnail-overlay-time-status-renderer");[...times].forEach(e=>{const t=e.querySelector("#text").innerHTML.trim().split(":");2===t.length&&t.unshift("0"),milliseconds(t[0],t[1],t[2])<=6e4&&(e.closest("ytd-grid-video-renderer").style.display="none")}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got annoyed with accidentally clicking on a short video, waiting for the page + video to load while only the audio plays with no option to pause the video to wait. So this just highlights those videos less than 1min it also makes live and premier ones blue.
Create a new bookmark, copy this code into the url section and click.