Last active
September 10, 2019 14:38
-
-
Save lesleh/a91b2674ad43bd83da12be778b7760e3 to your computer and use it in GitHub Desktop.
Delete watched YouTube videos from Watch Later. Only tested on the old layout.
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
const findVideos = () => [...document.querySelectorAll('.pl-video')]; | |
const watchedGreaterThanHalf = (video) => { | |
const progressBar = video.querySelector('.resume-playback-progress-bar'); | |
return progressBar && parseInt(progressBar.style.width) > 50; | |
} | |
const removeButton = (video) => x.querySelector('.pl-video-edit-remove'); | |
const click = (button) => button.click(); | |
findVideos() | |
.filter(watchedGreaterThanHalf) | |
.map(removeButton) | |
.forEach(click); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment