Created
August 4, 2026 16:18
-
-
Save TheWebDevel/26dbe127035cacfb8b95ac088642f342 to your computer and use it in GitHub Desktop.
Unsubscribe all of YT subscriptions
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
| (async () => { | |
| const sleep = ms => new Promise(r => setTimeout(r, ms)); | |
| while (true) { | |
| const subscribeBtn = document.querySelector( | |
| 'button[aria-label^="Unsubscribe from"]' | |
| ); | |
| if (!subscribeBtn) { | |
| console.log("🎉 Finished."); | |
| break; | |
| } | |
| console.log("Clicking:", subscribeBtn.getAttribute("aria-label")); | |
| subscribeBtn.click(); | |
| await sleep(800); | |
| const confirmBtn = [...document.querySelectorAll("button")] | |
| .find(b => /^unsubscribe$/i.test(b.innerText.trim())); | |
| if (!confirmBtn) { | |
| console.error("Couldn't find confirmation button."); | |
| break; | |
| } | |
| confirmBtn.click(); | |
| await sleep(1200); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment