Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
let items = []
const interval = setInterval(async function() {
if (items.length < 10) {
items = Array.from(document.querySelectorAll('#contents ytd-playlist-video-renderer:not([is-dismissed])'))
}
if (items.length === 0) {
clearInterval(interval)
return
}
const item = items.shift()
item.querySelector('yt-icon-button').click()
await sleep(50)
const drops = document.querySelectorAll('ytd-popup-container iron-dropdown ytd-menu-service-item-renderer paper-item');
(drops[3] || drops[0]).click();
await sleep(50)
}, 200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.