Skip to content

Instantly share code, notes, and snippets.

@syuraj
Last active February 2, 2025 16:36
Show Gist options
  • Save syuraj/7c44b959a7f9b226064f4bd8e2dad307 to your computer and use it in GitHub Desktop.
Save syuraj/7c44b959a7f9b226064f4bd8e2dad307 to your computer and use it in GitHub Desktop.
Youtube Unsubscribe All Script
// go to this link https://www.youtube.com/feed/channels
// run code below in browser console
(async () => {
const delay = (ms) => new Promise(res => setTimeout(res, ms));
let buttons = document.querySelectorAll('ytd-subscribe-button-renderer yt-button-shape button');
for (let button of buttons) {
if (button.innerText.trim().toLowerCase() === "subscribed") {
button.click();
await delay(1000);
let unsubBtn = document.querySelector("#items > ytd-menu-service-item-renderer:last-child > tp-yt-paper-item");
unsubBtn.click();
let confirmButton;
for (let i = 0; i < 10; i++) {
confirmButton = document.querySelector('#confirm-button button');
if (confirmButton) break;
await delay(300);
}
if (confirmButton) {
confirmButton.click();
await delay(500);
}
}
}
console.log("Unsubscribed from all channels.");
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment