Skip to content

Instantly share code, notes, and snippets.

@durchdacht
Created March 21, 2020 16:57
Show Gist options
  • Save durchdacht/0a6fa3da4917cd8c1046ce2c76acaff9 to your computer and use it in GitHub Desktop.
Save durchdacht/0a6fa3da4917cd8c1046ce2c76acaff9 to your computer and use it in GitHub Desktop.
// based on https://www.techjunkie.com/mass-unsubscribe-youtube/
// by YOGIE
var i = 0;
var count = document.querySelectorAll("ytd-channel-renderer:not(.ytd-item-section-renderer)").length;
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(i + " unsubscribed");
console.log(count + " remaining");
setTimeout(function () {
el = document.querySelector("ytd-channel-renderer");
el.parentNode.removeChild(el);
myTimer();
}, 250);
}, 250);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment