Skip to content

Instantly share code, notes, and snippets.

@willwm
Last active March 25, 2024 03:11
Show Gist options
  • Save willwm/c9b07cc927b10fedabe2d329ea9c36e6 to your computer and use it in GitHub Desktop.
Save willwm/c9b07cc927b10fedabe2d329ea9c36e6 to your computer and use it in GitHub Desktop.
Bookmarklet: Unsubscribe from YouTube channels in bulk
javascript:(() => {
const timeout = 500;
const buttons = document.querySelectorAll("[aria-label^='Unsubscribe from']");
for(let button of buttons) {
setTimeout(() => {
console.group(button.attributes['aria-label'].value);
setTimeout(() => { button.click(); }, timeout);
setTimeout(() => {
document.querySelector('#confirm-button').click();
}, timeout);
console.groupEnd();
}, timeout);
}
})();
@willwm
Copy link
Author

willwm commented Mar 28, 2019

Run this on https://www.youtube.com/feed/channels

(Derived from Stack Overflow sample code, here: https://stackoverflow.com/a/48874466/122283)

@rubberocket
Copy link

woah this actually works

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