Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save meszaros-lajos-gyorgy/ec0362f08dbe71f6ebbeeb78bf49c69f to your computer and use it in GitHub Desktop.
Save meszaros-lajos-gyorgy/ec0362f08dbe71f6ebbeeb78bf49c69f to your computer and use it in GitHub Desktop.
bulk remove items from youtube playlist
// 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