Created
July 11, 2021 20:46
-
-
Save rwohleb/136933b79f3e917f0638c2141b234b26 to your computer and use it in GitHub Desktop.
Mass delete Youtube Watch Later videos
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/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