Skip to content

Instantly share code, notes, and snippets.

@Ghost---Shadow
Created June 8, 2023 20:45
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 Ghost---Shadow/6987f53fe945cb9fa5cfc36687651267 to your computer and use it in GitHub Desktop.
Save Ghost---Shadow/6987f53fe945cb9fa5cfc36687651267 to your computer and use it in GitHub Desktop.
Remove all watched videos from watch later playlist
(async () => {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
watchedVideoOverlays = Array.from(document.getElementsByClassName('ytd-thumbnail-overlay-resume-playback-renderer'))
for(let i = 0; i < watchedVideoOverlays.length; i += 1){
console.log(i)
try{
container = watchedVideoOverlays[i].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
container.children[2].children[0].children[2].children[0].children[0].click()
await sleep(500)
menu = Array.from(document.getElementsByClassName('ytd-menu-popup-renderer'))
menu[3].click()
await sleep(1000)
} catch (e) {
console.error(e)
}
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment