Skip to content

Instantly share code, notes, and snippets.

@iamandrewluca
Last active August 10, 2021 10:36
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 iamandrewluca/0c90b04ceda129652828147a9145968d to your computer and use it in GitHub Desktop.
Save iamandrewluca/0c90b04ceda129652828147a9145968d to your computer and use it in GitHub Desktop.
Go to YouTube like videos playlist. Execute this script in console. Will start to remove likes from videos
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