Skip to content

Instantly share code, notes, and snippets.

@AsP3X
Last active December 14, 2021 14:21
Show Gist options
  • Save AsP3X/ef54e5c1a7f4c8d5eb83da314dd0eeaf to your computer and use it in GitHub Desktop.
Save AsP3X/ef54e5c1a7f4c8d5eb83da314dd0eeaf to your computer and use it in GitHub Desktop.
Removing all video inside of the youtubes watch later playlist.
var clearTimer;
function clearWatchList(interval) {clearTimer = setInterval(clearWatchLater, interval);}
function clearWatchLater(buttonName, fieldName) {
document.querySelector('#primary button[aria-label="Aktionsmenü"]').click();
var things = document.evaluate('//span[contains(text(),"Später ansehen")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
if (things.snapshotLength = 0) {killSwitch()}
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}
function killSwitch() {
clearInterval(clearTimer);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment