hatscripts / youtube-auto-liker Goto Github PK
View Code? Open in Web Editor NEWA userscript that automatically likes ๐ each video you watch on YouTube โถ๏ธ
A userscript that automatically likes ๐ each video you watch on YouTube โถ๏ธ
Stopped working
hi! script now not working. please fix
This started today.
If I set "LIKE_IF_NOT_SUBSCRIBED" to true, then it works and likes the video. When it's false, as I normally use it, it doesn't like videos from channels I'm subbed to anymore.
Windows 10 latest
Chrome Beta Version 90.0.4430.61 (Official Build) beta (64-bit)
Tampermonkey 4.12
Seems youtube has changed the id of the like button. At least this script didn't work for me.
How to fix it?
Simply change the selector in row 96 to
LIKE_BUTTON: '#top-level-buttons-computed > ytd-toggle-button-renderer:nth-child(1) > a > yt-icon-button',
Unless my installation just corrupted randomly, this script just stopped working with whatever update YT pushed.
Chrome-Tampermonkey
Violentmonkey ver 2.13.3, Chrome ver 107.0.5304.36
Using the script as is causes the "Loop Playlist" button to be pressed rather than the like button, changing the line
LIKE_BUTTON: '#top-level-buttons > ytd-toggle-button-renderer:nth-child(1), .like-button-renderer-like-button:not(.hid)',
to
LIKE_BUTTON: 'ytd-video-primary-info-renderer #top-level-buttons > ytd-toggle-button-renderer:nth-child(1), .like-button-renderer-like-button:not(.hid)',
fixes this issue
P.S Thank you for making this script, I have been looking for a working auto-like script for ages.
I was going to make a pull request with the new subscribe button, but then I saw you updated. Tampermonkey didn't update the script I installed via greasyfork however.
I think it was probably because you didn't update the version number?
I now updated manually. But maybe update the version number to 1.3.1?
This bug was fixed before hand, but I guess it's broken again. The like button isn't turning blue anymore without a refresh of the page. The script is working just fine, it's just a visual bug I'm assuming.
Hi guys :)
Since 3/4 days the script stopped working :( My chrome version is 121.0.6167.57. Do u have the same problem or it's just me?
Hello, nothing happens, no like...
YouTube Auto-Liker: Failed to like video: Error: Couldn't find sub button. Will try again in 5000 ms...
If you activate the option Like if not subscribed Works
Not sure why but it is not working for me both in edge and chrome even with version 1.3.26
No videos are being liked
The script didn't work for me, so I tried debugging it. Turns out it was the watchThresholdReached ()
function that was failing and in particular because of the calls player.getCurrentTime()
and player.getDuration()
- both of these properties turned out to be undefined
, so the script fails because it tries to execute undefined
as a function.
I'm not sure what the problem is, though. According to this SO answer the function shouldn't be available. However, that's from 2013 and maybe things changed. I've only started using the script about a week ago and then only now noticed it didn't work. So, not sure if it has worked before or not.
My solution was a bit of a hack - I surrounded the check in a try/catch:
function watchThresholdReached() {
let player = document.querySelector(SELECTORS.PLAYER)
try {
if (player) {
return player.getCurrentTime() / player.getDuration() >= OPTIONS.WATCH_THRESHOLD
}
} catch (e) {}
return true
}
It now works because it just defaults to true
if there is an error just like it defaults to true
if it doesn't find the player. However, I'm not sure this is really a good solution.
I'm using GreaseMonkey in Firefox 73.0.1 (64-bit) on Windows 10 to run the userscript, so I don't know if GM itself has more restrictions than alternatives or something else in my setup. It's possible that YouTube did something somewhat recently to make the player API not available again.
I use it on Tampermonkey 4.16.1 over Chrome 105.0.5195.125 running macos Monterey 12.6. Videos run to the end and no auto liking is done.
Just made a pull request! #20
Whenever I dislike a video before the progress bar percentage for the "Watch Threshold" setting is reached, it likes the video it has been reached.
You can reproduce this by setting the watch threshold to something above 0, disliking the video, then going past the progress percentage you entered.
I don't know how to fix this because I don't know any JavaScript or HTML. But I do know why it's happening, it's because you don't have the dislike button in the "SELECTORS" constant thing. If you didn't add this for a reason, go ahead and close this issue.
Sometime in early 2018, Youtube change something in their code. Using Tampermonkey, the YouTubeAutoLiker script will load after refreshing the page. See this issue on both Firefox and Chrome. Also see feedback on Greasy Fork as other people are see same issue.
First of all: Thank you for this absolutely AMAZING script. I do not have the skills required to code anything like this, and it runs smoothly. You are AWESOME!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.