Created
July 25, 2020 22:59
-
-
Save igorferreira/114feaac353b7885502ccd644157da34 to your computer and use it in GitHub Desktop.
unsubscribe all youtube channels script v2
This file contains hidden or 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
function youtubeUnsubscriber() { | |
var count = document.querySelectorAll("ytd-channel-renderer:not(.ytd-item-section-renderer)").length; | |
var randomDelay = 500; | |
if(count == 0) return false; | |
function unsubscribeVisible(randomDelay) { | |
if (count == 0) { | |
window.scrollTo(0,document.body.scrollHeight); | |
setTimeout(function() { | |
youtubeUnsubscriber(); | |
}, 10000) | |
} | |
unsubscribeButton = document.querySelector('.ytd-subscribe-button-renderer'); | |
unsubscribeButton.click(); | |
setTimeout(function () { | |
document.getElementById("confirm-button").click() | |
count--; | |
console.log("Remaining: ", count); | |
setTimeout(function () { | |
unsubscribedElement = document.querySelector("ytd-channel-renderer"); | |
unsubscribedElement.parentNode.removeChild(unsubscribedElement); | |
unsubscribeVisible(randomDelay) | |
}, randomDelay); | |
}, randomDelay); | |
} | |
unsubscribeVisible(randomDelay); | |
} | |
youtubeUnsubscriber(); |
Author
igorferreira
commented
Jul 25, 2020
- Access the link : https://www.youtube.com/feed/channels
- Press F12
- Insert the code below in your console
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment