Skip to content

Instantly share code, notes, and snippets.

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 claudiojunior-me/6df1a173ba6bf836c6508e6e6e133d5f to your computer and use it in GitHub Desktop.
Save claudiojunior-me/6df1a173ba6bf836c6508e6e6e133d5f to your computer and use it in GitHub Desktop.
Script to remove all videos from Youtube Watch Later playlist

UPDATED 3.12.2020

The old version of youtube with "disable_polymer" is not working anymore, so the script also stopped working.

Thanks to JanTheDeveloper we have a new working script. Big up!

I just changed the '//span[contains(text(),"Watch later")]', to '//span[contains(text(),"Remove from")]', and it should work for any playlist, not just the watch later one. (thanks to hudsonite for the tip)

setInterval(function () {
  document.querySelector('#primary button[aria-label="Action menu"]').click();
  var things = document.evaluate(
    '//span[contains(text(),"Remove from")]',
    document,
    null,
    XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
    null
  );
  for (var i = 0; i < things.snapshotLength; i++) {
    things.snapshotItem(i).click();
  }
}, 1000);

I moved the old working code to another gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment