Last active
October 11, 2023 08:06
-
-
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
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
// 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