Last active
August 10, 2021 10:36
-
-
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
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
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