Forked from viveknaskar/unsubscribe-youtube-channels.js
Last active
August 13, 2022 15:20
-
-
Save mohandarsi/93fb96a4d2f80615daa3f53da6c334ca to your computer and use it in GitHub Desktop.
A script that can be executed to unsubscribe all the YouTube channels at once.
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, 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 () { | |
| var unSubBtn = document.getElementById("confirm-button").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