Skip to content

Instantly share code, notes, and snippets.

@fitsum
Last active April 26, 2024 05:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitsum/23c9ac56240e5181d877dd6121d3e891 to your computer and use it in GitHub Desktop.
Save fitsum/23c9ac56240e5181d877dd6121d3e891 to your computer and use it in GitHub Desktop.
removing likes from youtube clips until YT baffles the effort
// https://www.youtube.com/playlist?list=LL
let currentLike = 1,
// should allow time for menu open and click
removeDelay = 150,
// should be double remove delay
countDelay = removeDelay*2,
// get current total from stats section
totalLikes = parseInt(document.querySelector('#stats yt-formatted-string').textContent);
const countLikes = setInterval(()=>{
if(currentLike > totalLikes) {clearInterval(countLikes)}
document.querySelector(`ytd-playlist-video-renderer:nth-child(${currentLike}) #menu ytd-menu-renderer yt-interaction`).click();
const removeLike = setTimeout(()=>{
document.querySelector('ytd-menu-service-item-renderer:nth-child(5) > tp-yt-paper-item').click();
clearTimeout(removeLike);
},removeDelay);
console.log(`removed ${currentLike}`)
cuurentLike++;
},countDelay);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment