Skip to content

Instantly share code, notes, and snippets.

@maruf89
Last active July 16, 2017 08:57
Show Gist options
  • Save maruf89/0f92bb32d1006d0429047cb9f0700530 to your computer and use it in GitHub Desktop.
Save maruf89/0f92bb32d1006d0429047cb9f0700530 to your computer and use it in GitHub Desktop.
Clear your youtube watch later playlist. Paste this into your inspector, change the start & end variables to only remove a portion, or all videos in your playlist.
var start = 0; // starts from the first video
var end = 9; // deletes the first ten videos, set to -1 to remove all
var removeButtons = Array.prototype.slice.call(document.querySelectorAll('.pl-video .pl-video-edit-remove'), start, end);
// gathers all of the remove buttons and triggers a click event on all of the selected with a 250 ms interval
removeButtons.forEach(function (elem, index) { setTimeout(function () { console.log('removing index ' + index); elem.click() }, index * 250) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment