Last active
December 17, 2024 20:39
-
-
Save meszaros-lajos-gyorgy/ec0362f08dbe71f6ebbeeb78bf49c69f to your computer and use it in GitHub Desktop.
bulk remove items from youtube playlist
This file contains hidden or 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
// removes 10 items from the list, feel free to increase 10 to whatever | |
for (let i = 0; i < 10; i++) { | |
setTimeout(() => { | |
console.log(i) | |
// clicks the menu button in the first row of video | |
document.querySelector('ytd-playlist-video-renderer:not([is-dismissed]) .dropdown-trigger button').click() | |
// wait a bit until the menu appears | |
setTimeout(() => { | |
// click the last menu item in the list | |
document.querySelector('ytd-menu-service-item-renderer:last-child').click() | |
}, 100) | |
}, i * 1000) // try increasing this delay if a lot of video removals get skipped | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment