Created
January 15, 2020 23:22
-
-
Save lucabelluccini/e466eb7ab96e8ab7762e2d18120d28f4 to your computer and use it in GitHub Desktop.
Unsubscribe from YT Channels massively (Italian - Replace labels with your language)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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