Skip to content

Instantly share code, notes, and snippets.

@wooningeire
Created May 29, 2023 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wooningeire/68c562d9e93ac296b4d5b5867892ce2a to your computer and use it in GitHub Desktop.
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)
(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