Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dominicusin/bc11f740687bcde1b2578bd00b6fbb1a to your computer and use it in GitHub Desktop.
Save dominicusin/bc11f740687bcde1b2578bd00b6fbb1a to your computer and use it in GitHub Desktop.
unsubscribe all youtube channels script v2
function youtubeUnsubscriber() {
var count = document.querySelectorAll("ytd-channel-renderer:not(.ytd-item-section-renderer)").length;
var randomDelay = 500;
if(count == 0) return false;
function unsubscribeVisible(randomDelay) {
if (count == 0) {
window.scrollTo(0,document.body.scrollHeight);
setTimeout(function() {
youtubeUnsubscriber();
}, 10000)
}
unsubscribeButton = document.querySelector('.ytd-subscribe-button-renderer');
unsubscribeButton.click();
setTimeout(function () {
document.getElementById("confirm-button").click()
count--;
console.log("Remaining: ", count);
setTimeout(function () {
unsubscribedElement = document.querySelector("ytd-channel-renderer");
unsubscribedElement.parentNode.removeChild(unsubscribedElement);
unsubscribeVisible(randomDelay)
}, randomDelay);
}, randomDelay);
}
unsubscribeVisible(randomDelay);
}
youtubeUnsubscriber();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment