Skip to content

Instantly share code, notes, and snippets.

@viveknaskar
Created February 17, 2022 16:06
Show Gist options
  • Save viveknaskar/b5f71e19dbdf430454f811e609ee8eeb to your computer and use it in GitHub Desktop.
Save viveknaskar/b5f71e19dbdf430454f811e609ee8eeb to your computer and use it in GitHub Desktop.
A script that can be executed to unsubscribe all the YouTube channels at once.
var i = 0;
var count = document.querySelectorAll(
"ytd-channel-renderer:not(.ytd-item-section-renderer)"
);
myTimer();
function myTimer() {
if (count == 0) return;
el = document.querySelector(".ytd-subscribe-button-renderer");
el.click();
setTimeout(function () {
var unSubBtn = document.getElementById("confirm-button").click();
i++;
count--;
console.log("channel " + i + " unsubscribed");
setTimeout(function () {
el = document.querySelector("ytd-channel-renderer");
el.parentNode.removeChild(el);
myTimer();
}, 250);
}, 250);
}
@tasnuva1
Copy link

This one is working. First, you have to go to the bottom of the page and then open up the console.

@thorrrr
Copy link

thorrrr commented Oct 27, 2022

This ran through everything said i was unsubscribed took about 20 min for 600 subs. Said it was successful but back in YouTube they are all still showing as subscribed. I have tried logging out and in and clear cache but all still showing not 1 removed????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment