Created
June 8, 2023 20:45
-
-
Save Ghost---Shadow/6987f53fe945cb9fa5cfc36687651267 to your computer and use it in GitHub Desktop.
Remove all watched videos from watch later playlist
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
(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