Skip to content

Instantly share code, notes, and snippets.

@AbuzerAsif
Last active September 8, 2024 09:42
Show Gist options
  • Select an option

  • Save AbuzerAsif/05a2a186f052a1164b0cb32f6ecc531d to your computer and use it in GitHub Desktop.

Select an option

Save AbuzerAsif/05a2a186f052a1164b0cb32f6ecc531d to your computer and use it in GitHub Desktop.
Youtube unsubscribe all
var i = 0;
var myVar = setInterval(myTimer, 3000);
function myTimer() {
var els = document.getElementById("grid-container").getElementsByClassName("ytd-expanded-shelf-contents-renderer");
if (i < els.length) {
els[i].querySelector("[aria-label^='Unsubscribe from']").click();
setTimeout(function () {
document.querySelector('#confirm-button .yt-spec-button-shape-next').click()
}, 2000);
setTimeout(function () {
els[i].parentNode.removeChild(els[i]);
}, 2000);
}
i++;
console.log(i + " Channels Unsubscribed\n");
console.log(els.length + " remaining");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment