Created
February 17, 2022 16:06
-
-
Save viveknaskar/b5f71e19dbdf430454f811e609ee8eeb to your computer and use it in GitHub Desktop.
A script that can be executed to unsubscribe all the YouTube channels at once.
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 count = document.querySelectorAll( | |
"ytd-channel-renderer:not(.ytd-item-section-renderer)" | |
); | |
myTimer(); | |
function myTimer() { | |
if (count == 0) return; | |
el = document.querySelector(".ytd-subscribe-button-renderer"); | |
el.click(); | |
setTimeout(function () { | |
var unSubBtn = document.getElementById("confirm-button").click(); | |
i++; | |
count--; | |
console.log("channel " + i + " unsubscribed"); | |
setTimeout(function () { | |
el = document.querySelector("ytd-channel-renderer"); | |
el.parentNode.removeChild(el); | |
myTimer(); | |
}, 250); | |
}, 250); | |
} |
the button id I think may be something that varies by region, for me it was
subscribe-button
Oh, I didn't know that. I think YouTube (just like other apps) localizes their web apps in accordance to different countries. Thank you for letting me know.
Great bro, ty
Glad, it was useful.
This one is working. First, you have to go to the bottom of the page and then open up the console.
This ran through everything said i was unsubscribed took about 20 min for 600 subs. Said it was successful but back in YouTube they are all still showing as subscribed. I have tried logging out and in and clear cache but all still showing not 1 removed????
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Glad, it worked for you.