Skip to content

Instantly share code, notes, and snippets.

@codergautam
Created December 20, 2021 14:55
Show Gist options
  • Save codergautam/4eb558c0edfa89280b6feabbb8f2cf34 to your computer and use it in GitHub Desktop.
Save codergautam/4eb558c0edfa89280b6feabbb8f2cf34 to your computer and use it in GitHub Desktop.
Unsubscribe from everyone on YouTube!
// STEPS TO USE:
// 1. Go to https://www.youtube.com/feed/channels
// 2. Right click > Inspect Element > Console
// 3. Paste script
// 4. Press enter
var count = document.querySelectorAll("ytd-channel-renderer:not(.ytd-item-section-renderer)").length;
tick();
function tick() {
if (count == 0) return console.log("Completed! Subscribe to Coder Gautam on YT!");
el = document.querySelector('.ytd-subscribe-button-renderer');
el.click();
setTimeout(function () {
var unSubBtn = document.getElementById("confirm-button").click();
count--;
console.log(count + " remaining");
setTimeout(function () {
el = document.querySelector("ytd-channel-renderer");
el.parentNode.removeChild(el);
tick();
}, 5);
}, 5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment