Created
February 27, 2025 17:22
-
-
Save hayleyxyz/fe1d6ca170314a3c7be525acd5f87450 to your computer and use it in GitHub Desktop.
Clear YouTube playlist
This file contains hidden or 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 | |
setInterval(function() { | |
document.querySelector('#primary button[aria-label="Action menu"]').click(); | |
var things = document.evaluate('//span[contains(text(),"Watch later")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
for (var i = 0; i < things.snapshotLength; i++) { | |
things.snapshotItem(i).click(); | |
} | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment