Skip to content

Instantly share code, notes, and snippets.

@joanna-liana
Created June 28, 2023 14:29
Show Gist options
  • Save joanna-liana/cfe3325ebee106fd312bf69c023bdd83 to your computer and use it in GitHub Desktop.
Save joanna-liana/cfe3325ebee106fd312bf69c023bdd83 to your computer and use it in GitHub Desktop.
Bulk remove items from YouTube's Watch Later playlist
// to be run in the browser
// at https://www.youtube.com/playlist?list=WL
// might need a few reruns based on the number of items
function removeWatchLaterItems() {
const items = Array.from(document.querySelector("div.ytd-playlist-video-list-renderer:nth-child(3)").children);
for (let i = 0; i < items.length; i++) {
const item = items[i];
setTimeout(() => {
item.querySelector('button').click();
document.querySelector("ytd-menu-service-item-renderer.style-scope:nth-child(3)").click();
}, 2000 + i * 500)
}
}
removeWatchLaterItems();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment