Created
October 14, 2019 01:32
-
-
Save metanomial/39042ae12273cecc2c05482046ae6c29 to your computer and use it in GitHub Desktop.
Systematically like all YouTube videos in a playlist. Watch out for autoplay
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
// Skip delay in milliseconds | |
// Raise if your connection is slow | |
const delay = 8000; | |
function autolike() { | |
const likeButton = document.querySelector('button[aria-label^=like]') | |
const nextButton = document.querySelector('.ytp-next-button') | |
if(!isSelected(likeButton)) likeButton.click() | |
nextButton.click(); | |
setTimeout(autolike, delay) | |
} | |
function isSelected(button) { | |
const icon = button.querySelector('.yt-icon'); | |
const fill = window.getComputedStyle(icon).fill; | |
return fill == 'rgb(62, 166, 255)'; | |
} | |
autolike() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment