Last active
April 26, 2024 05:19
-
-
Save fitsum/23c9ac56240e5181d877dd6121d3e891 to your computer and use it in GitHub Desktop.
removing likes from youtube clips until YT baffles the effort
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
// 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