Skip to content

Instantly share code, notes, and snippets.

@Serrin
Last active July 23, 2021 22:29
Show Gist options
  • Save Serrin/7becc3b0189381e2e214c80d5c2f6bad to your computer and use it in GitHub Desktop.
Save Serrin/7becc3b0189381e2e214c80d5c2f6bad to your computer and use it in GitHub Desktop.
Youtube hide videos from the subscriptions page (https://www.youtube.com/feed/subscriptions)
[...document.querySelectorAll(".style-scope .ytd-menu-renderer")]
.filter((v) => v.className === "style-scope ytd-menu-renderer")
//.slice(0,50) // change here to hide more videos or comment this line to hide all
.forEach( (v,i,a) => {
console.log((i + 1) + " / " + a.length);
v.click();
//[...document.querySelectorAll(".style-scope .ytd-menu-service-item-renderer")]
//.filter( (v) => v.innerHTML === "Hide" )
// //.forEach((v)=>v.click());
//.at(-1).click();
[...document.getElementsByClassName("ytd-menu-service-item-renderer")]
.find( (v) => v.innerHTML === "Hide" )
.click();
});
document.querySelectorAll('[is-dismissed=""]')
.forEach( (v,i,a) => v.remove() );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment