Skip to content

Instantly share code, notes, and snippets.

@robleh
Last active December 9, 2021 21:20
Show Gist options
  • Select an option

  • Save robleh/f5bff8f7bfeedcc9296215334207da66 to your computer and use it in GitHub Desktop.

Select an option

Save robleh/f5bff8f7bfeedcc9296215334207da66 to your computer and use it in GitHub Desktop.
Unsubscribe from all YouTube subcriptions
subButtons = document.getElementsByClassName("style-scope ytd-subscribe-button-renderer")
for (i = 0; i < subButtons.length; i++) {
if (subButtons[i].tagName == "TP-YT-PAPER-BUTTON") {
if (subButtons[i].getAttribute("aria-label").startsWith("Unsubscribe")) {
subButtons[i].click();
document.getElementsByClassName("style-scope yt-button-renderer style-blue-text size-default")[0].click();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment