Last active
May 2, 2020 11:42
-
-
Save jordyvandomselaar/44f56e2051c942bdc3cd3cbab9ef2f85 to your computer and use it in GitHub Desktop.
Go to https://www.youtube.com/feed/channels, scroll all the way to the bottom then run this script to clear all of your subscriptions.
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
const unSubscribe = () => { | |
Array.from(document.querySelectorAll("yt-formatted-string")) | |
.find(yfs => yfs.textContent === "Subscribed") | |
.click(); | |
setTimeout(() => { | |
Array.from(document.querySelectorAll("yt-formatted-string")) | |
.filter(yfs => yfs.textContent === "Unsubscribe") | |
.forEach(yfs => yfs.click()); | |
}, 400); | |
}; | |
const amountOfSubscriptions = Array.from(document.querySelectorAll("yt-formatted-string")) | |
.filter(yfs => yfs.textContent === "Subscribed") | |
.length; | |
let currentSubscriptionNumber = 1; | |
const unSubScribeAll = () => { | |
setTimeout(() => { | |
unSubscribe(); | |
console.log(`${amountOfSubscriptions - currentSubscriptionNumber} remaining.`); | |
currentSubscriptionNumber++; | |
unSubScribeAll(); | |
}, 1000); | |
}; | |
console.log(`Removing ${amountOfSubscriptions} subscriptions.`); | |
unSubScribeAll(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment