Skip to content

Instantly share code, notes, and snippets.

@rwohleb
Created July 11, 2021 20:46
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 rwohleb/136933b79f3e917f0638c2141b234b26 to your computer and use it in GitHub Desktop.
Save rwohleb/136933b79f3e917f0638c2141b234b26 to your computer and use it in GitHub Desktop.
Mass delete Youtube Watch Later videos
// Go to https://www.youtube.com/playlist?list=WL and run this in browser console.
var popupContainer = $("ytd-popup-container");
var videos = $("ytd-playlist-video-list-renderer #contents").getElementsByClassName("ytd-playlist-video-list-renderer")
function removeVideo() {
if (videos.length) {
videos[0].getElementsByTagName("button")[0].click();
setTimeout(function() {
var dropdown = popupContainer.getElementsByTagName("tp-yt-iron-dropdown");
console.log(dropdown);
var stringElems = dropdown[0].getElementsByClassName("yt-formatted-string");
console.log(stringElems);
if (stringElems[0].innerText.trim() == "Remove from") {
stringElems[0].click();
}
setTimeout(removeVideo, 500);
}, 100);
}
}
setTimeout(removeVideo, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment