Last active
June 1, 2024 10:55
-
-
Save aoqia194/d4bd3fb8ff7e5e8e37aca13f28d5c82f to your computer and use it in GitHub Desktop.
A really bad mass YouTube channel unsubscriber!
This file contains 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
var i = 0; | |
var intval = setInterval(unsubscribeFromChannel, 1000); | |
function unsubscribeFromChannel() { | |
let gridContainer = document.getElementById("grid-container"); | |
let channelShelf = gridContainer.getElementsByClassName("ytd-expanded-shelf-contents-renderer"); | |
if (i < channelShelf.length) { | |
channelShelf[i].querySelector("[aria-label^='Current setting is ']").click(); | |
// Click unsubscribe entry in listbox | |
let paperListbox = document.getElementsByTagName("tp-yt-paper-listbox")[0]; | |
paperListbox.children[3].click(); | |
// Click unsubscribe button in confirmation popup | |
let confirmPopup = document.getElementsByTagName("yt-confirm-dialog-renderer")[0]; | |
confirmPopup.querySelector("[aria-label='Unsubscribe']").click(); | |
} | |
i++; | |
console.log("Unsubscribed from " + i + "channels.\n"); | |
console.log(channelShelf.length + " channels remaining."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go to https://youtube.com/feed/channels/ and paste script into browser console.