Skip to content

Instantly share code, notes, and snippets.

@lucabelluccini
Created January 15, 2020 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucabelluccini/e466eb7ab96e8ab7762e2d18120d28f4 to your computer and use it in GitHub Desktop.
Save lucabelluccini/e466eb7ab96e8ab7762e2d18120d28f4 to your computer and use it in GitHub Desktop.
Unsubscribe from YT Channels massively (Italian - Replace labels with your language)
var i = 0;
var myVar = setInterval(myTimer, 1600);
var els = document.getElementById("grid-container").getElementsByClassName("ytd-expanded-shelf-contents-renderer");
function myTimer () {
if (i < els.length) {
var unS = els[i].querySelector("[aria-label^='Annulla l']");
if (unS) {
unS.click();
setTimeout(function () {
var unSubBtn = document.querySelector("[aria-label^='Annulla iscrizione']");
if (unSubBtn) {
unSubBtn.click();
i++;
}
}, 800);
}
console.log((els.length-i) + " remaining");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment