Skip to content

Instantly share code, notes, and snippets.

@SiegfriedEhret
Last active October 11, 2023 08:06
Show Gist options
  • Save SiegfriedEhret/1adcf6ea01bef9b1724cba257810af56 to your computer and use it in GitHub Desktop.
Save SiegfriedEhret/1adcf6ea01bef9b1724cba257810af56 to your computer and use it in GitHub Desktop.
Remove some YouTube subscriptions (but more are loaded when I scroll so voilà) #WorksOnMyComputer
// Go to https://www.youtube.com/feed/channels
async function wait(cb) {
return new Promise(resolve => {
cb();
setTimeout(resolve, 250);
})
}
async function run() {
for (const s of Array.from($$("#content-section"))) {
await wait(() => s.querySelector("#notification-preference-button button").click());
await wait(() => {
const nodes = $("#contentWrapper").querySelectorAll("tp-yt-paper-item");
Array.from(nodes)[nodes.length - 1].click();
})
await wait(() => $("#confirm-button button").click())
}
}
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment