Skip to content

Instantly share code, notes, and snippets.

@Fray117
Last active April 15, 2022 13:04
Show Gist options
  • Save Fray117/d44e7edb1e2504c427990300c722cd46 to your computer and use it in GitHub Desktop.
Save Fray117/d44e7edb1e2504c427990300c722cd46 to your computer and use it in GitHub Desktop.
YouTube Auto Unsubscribe
var container = document.getElementById("grid-container").getElementsByClassName("ytd-expanded-shelf-contents-renderer");
for (let i = 0; i < container.length; i++) {
setTimeout(() => {
container[i].querySelector("[aria-label^='Unsubscribe from']").click();
document.getElementById("confirm-button").click();
console.log(`${container[i].children[1].children[1].children[0].children[0].children[0].innerText
} unsubscribed (${i} out of ${container.length})`);
}, 2000);
}
@Fray117
Copy link
Author

Fray117 commented Apr 15, 2022

Known Issues:

  1. Last channel not automatically unsubscribed
  2. Channels container might splitted as this script are heavily relied on them
  3. Delay are too not natural

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment