Created
May 29, 2023 05:02
-
-
Save wooningeire/68c562d9e93ac296b4d5b5867892ce2a to your computer and use it in GitHub Desktop.
Simple script that clicks "Not interested" on every recommendation on the YouTube home page (2021-03-07)
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
(async function list(elements, i=0, delay=50) { | |
const x = elements[i]; | |
if (!x) return; | |
x.click(); | |
await new Promise(resolve => { | |
setTimeout(resolve, delay); | |
}); | |
const listbox = document.querySelector("tp-yt-paper-listbox"); | |
(listbox.children[4] ?? listbox.children[0]).click(); // [0] handles Mix playlists which only have a "Not interested" button | |
setTimeout(() => { | |
list(elements, i + 1); | |
}, delay); | |
})(document.querySelectorAll("[aria-label='Action menu']")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment