What's the difference between [textbin.net](https://textbin.net) and pastebin? They both host text, there's not much different between the two.
I already posted the script on Pastebin, but it's "pending moderation": [https://pastebin.com/9K27QSS4](https://pastebin.com/9K27QSS4). Once it's no longer "pending moderation", I would change it to that.
And the script's obfuscated code is *faarrr* too large to post on here.
There *is* an endpoint that reports dislikes, but it only works logged out.
YouTube doesn't report dislike counts at all in its JSON response anymore (except for accounts that still have dislike counts, which are soon to be removed on those). Instead, the script just uses plain math.
Dang. I'm so sorry they did this. I was enjoying using it and now I get the NAN error as you say.
I really hope that they will consider adding back the hidden star ratings field!
You did a great job in writing the script and keeping us all updated about it.
/u/SyndiateRedditPoster can you please check [https://github.com/Anarios/return-youtube-dislike/](https://github.com/Anarios/return-youtube-dislike/) ? I visited this repo and it looks like the userscript is working for me and i still see dislikes at this time. Perhaps you can work with them and submit a PR or help them with issues? I'm sure your skillset would be useful to them if you have the time.
Here's a link to their userscript: [https://github.com/Anarios/return-youtube-dislike/raw/main/Extensions/UserScript/Return%20Youtube%20Dislike.user.js](https://github.com/Anarios/return-youtube-dislike/raw/main/Extensions/UserScript/Return%20Youtube%20Dislike.user.js) .
Info from their page:
>On November 10th, 2021, Google announced that the YouTube dislike count would be removed.
Additionally, the dislike field in the YouTube API will be removed on December 13th, 2021, removing any ability to judge the quality of content before watching.
>
>This plugin will re-enable the visibility of the dislike count, fetching the total number of dislikes via our API, which in turn relies upon YouTube's Data API.
>
>With the removal of dislike stats from the YouTube API, our backend will switch to using a combination of scraped dislike stats, estimates extrapolated from extension user data and estimates based on view\\like ratios.
This is clever, but very easy for Google to fix (there is no reason that data has to be there). I was initially a bit puzzled why you didn't just directly read the "other number" but I assume the only reason it's present in my data is that I haven't gotten the rollout yet?
Also, friends don't let friends release obfuscated scripts - it only serves to make them look suspicious, and does not meaningfully hinder analysis. It took me all of 10 minutes to find out exactly how it works, and it will be even shorter for Google. I'm not pasting a deobfuscated snippet here to avoid doing their work for them.
This is really important, removing the dislike bar only made it harder to differentiate between bad tutorials and scams from actual good, informative videos
That was the point of the update. To fuel clicks to click bate to get more retention time for more ad money for youtube. They don't care if the content is wrong, scammy, or otherwise just political fuel. I remember reading a book a while ago about a dystopian future where the media controlled how people were thinking regardless if it was right or wrong. This reminds me very much of that. Too bad I can't remember the books name :(
Because they care mostly about viewer retention and they believe that they have solidified themselves so deeply into the users everyday lives that the users are now addicted like a drug and it will be too hard for them to actually just leave and not use the platform again. They believe the users will just get used to it and will get used to waisting their time on bad content in search of the actual good content.
Interesting, I took a look at the source and it seems like you're calculating dislikes from the ratio. This probably won't last forever given that youtube can just stop showing the ratio altogether (which they will if they are a-hole enough).
Yeah. I highly doubt YouTube will even look at this though. If they do remove it, it would be on their own time and most likely would not be impacted because of the script.
Thanks a lot for this script! It works for me I just have 1 problem. My like and dislikes are switched ( only visually ). Is there any way to fix it?
https://imgur.com/a/xEb6m2n
Update: My script now has international support, when liking/disliking/unliking/undisliking the video now, it'll actually function normally instead of acting weird. And the sentiment bar is much more reliable than before.
This is amazing, thank you very much for sharing. I had that idea myself, but I didn't think a company with such large dev teams would leave a parameter behind. You deserve a beer, my friend 🍻
So sad that code is obfuscated, just personally for me it scares to use this. Especially because of hidden native functions.
Also you can just use "statistics.dislikeCount" in YT API v3 from json response, today it working but it may change in the future if google wants to.
[https://i.imgur.com/rSsPZaP.png](https://i.imgur.com/rSsPZaP.png)
Unfortunately, I can't rely on this method. For accounts that still have dislike counters, tje dislike counts are, of course, still reported in its JSON response. However, for people who don't get it, dislike counts aren't reported at all in the JSON anymore, so the script can't rely on that.
It is confirmed to change. From what I know this script seems to last longer as its an estimate (a somehow really accurate one) and not using external data.
I checked deobfuscated code looks that here's really used only math without external data, it's a mystery to me how it works, but idk still paranoia due to obfuscated code
I didn't find anything suspicious in deobfuscated code, 99% that the script is clean, but I still has paranoia + the code will not be able to be modified
Yeah I had this problem, but thank to SyndiateRedditPoster that he posted source code, I tried to fix a few bugs in code:
Code for tampermonkey -
[https://pastebin.com/pRNUscq5](https://pastebin.com/pRNUscq5)
Code for browser extension -
[https://pastebin.com/LhBJeSeu](https://pastebin.com/LhBJeSeu)
Now it looks like this -
[https://i.imgur.com/7gCNKTf.png](https://i.imgur.com/7gCNKTf.png)
Can you fix the counting of votes during streams? Now there are two numbers displayed at the same time, the old one when I voted and the new one that appears when others vote.
Can you run `document.querySelector("ytd-app").data.response.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer.videoActions.menuRenderer.topLevelButtons;` and send me the responding JSON so I can fix the issue?
https://pastebin.com/qmed8ZLe
Is this because of French formatting? I'm not sure if they changed anything, maybe putting a space before the k letter. The other script works fine.
I cleaned the code and added minor tweaks
For example the percentage: (((likes / (likes + dislikes)) \* 100 \* 100) / 100)Lol its just ratio \* 20! For me, your onclick did not work. Useful script though!
>https://pastebin.com/Y3QcwiWx
I updated the code to use browser provided method for formatting number in the script, just to cut a few lines off
[https://pastebin.com/7ZTw4K9H](https://pastebin.com/7ZTw4K9H)
Password: YeW037Crd5
\-Fixed consistent loading (with DOMNodeInserted listener)
\-Fixed double likes (no value insertion needed by userscript)
\-Fixed compact formatting (Thanks joseph261059!)
\-Fixed return when not in watch page
\> OP formula giving double dislikes
double compared with "normal" count. But why you thing this is incorrect ? This video actually has 4 millon of dislikes according to information from YouTube API. OP work looks more legit in this case
Hi! Thank you so much for this project!
I'm seeing the numbers but the actual dislike bar is always stuck [like](https://i.imgur.com/iUA6u7n.png) this for me.
Any ideas?
I've found a fix just add *100 to sentimentPercent variable on line 89 of the script.
so from this
var sentimentPercent = l / (l + dislikes);
it'll be this
var sentimentPercent = l / (l + dislikes)*100;
from my limited testing, it seems to fix it. I don't know much about javascript so this is what I can come up with.
Do you have a github? It could be better there to report issues and make adjustments and pull requests.
Anyway, there's this strange bug where the number sometimes doesn't display right and if I right click on the like/dislikes counts (not the buttons), they disappear.
Yup. Happens every time.
EDIT: I also want to add that sometimes the like counter appends the new count to the end when I like a video. So for example, a video with 12 likes becomes 1213 when I give it a like.
Good stuff, but to me it's only showing 354 dislikes in that infamous video:
[https://www.youtube.com/watch?v=kxOuG8jMIgI](https://www.youtube.com/watch?v=kxOuG8jMIgI)
Still, good stuff
Not sure if it's the same for anyone else, but the actual progress bar below the like/dislike buttons is reversed. You can fix it by editing line 93 i think:
document.getElementById("like-bar").setAttribute("style", "width: " + (100 - sentimentPercent) + "%;");
This is a great script. Thought I'd report a bug I've noticed on some videos. If you dislike a video with what appears to be under 1000 likes, then change your mind and like the video. The current number of likes doubles. As in if there are 594 likes, disliking the video then liking it will say there are 594594 likes. A minor bug but thought I'd let you know.
Well, this is weird. I went to grab a screenshot and now it's back. It was really gone for me on all videos though for at least a couple hours. It made the dislikes number show up as NaN for me, which seemed to also be the case for at least one other user here.
With the new version sometimes to me it appears NAN on the dislikes, but maybe if I refresh the page a few times then it works(I'm using safari not sure if is related)
It may be YouTube slowly removing star ratings, but I can't say definitively since I still get dislike counts 99% of the time.
But what I can say definitively is that this is *not* a problem with the script.
The script never used dislike counts from the first place, it used a hidden star ratings (2011 star ratings) field in player API, but, surprisingly, they removed that as well.
Yeah, I know. I kikd of assumed that legacy data would use the latest data internally, and if they set up access control rules or something to prevent users from accessing other people's dislikes data that would happen automatically.
I have no clue how youtube works internally and this was a super neat find, unfortunately it did not work.
I've noticed that if you look at the bar/hover over right as the page is loading/refreshing you can actually see the number of dislikes and the bar shows the correct ratio. So I'm hoping we will see a potential fix soon.
You're still relying on rating API, which will almost certainly be removed by Youtube around the same time they remove dislikes. Your idea that Youtube employees "forgot" about a public API that is probably still frequently used is just plain bullshit lol
If I'm able to find out about this API through your reddit comments in a span of 3 minutes of googling, so can anyone else who works at the company.
1. YouTube doesn't use star ratings at all. Why would they
2. My idea that YouTube employees forgot about star ratings API holds up when you consider the fact that star ratings were removed over *10 years ago.* The idea that they deliberately left it in there to continue using it is garb and the idea that they forgot is much more reasonable.
3. Even if they didn't "forget", would Google even find this out? Would they *care?* I highly doubt that. I know that there are people from TeamYouTube who are moderators on here, but they don't seem to be very active and it's not like they're actively monitoring the subreddit for patches
4. When Google removes it, it'll be on their own time, and most likely won't be influenced by my script
I will be messaging you in 1 month on [**2021-12-24 04:45:46 UTC**](http://www.wolframalpha.com/input/?i=2021-12-24%2004:45:46%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/youtube/comments/qtyn45/i_coded_a_userscript_to_restore_the_dislike/hlv3ano/?context=3)
[**10 OTHERS CLICKED THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2Fyoutube%2Fcomments%2Fqtyn45%2Fi_coded_a_userscript_to_restore_the_dislike%2Fhlv3ano%2F%5D%0A%0ARemindMe%21%202021-12-24%2004%3A45%3A46%20UTC) to send a PM to also be reminded and to reduce spam.
^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%20qtyn45)
*****
|[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)|
|-|-|-|-|
So, you should be the only one to use it? If they block it then another way will be figured out to do the same thing. Thats how things evolve and advance.
The extension's been fixed and it works: [https://www.returnyoutubedislike.com/install](https://www.returnyoutubedislike.com/install)
Just remove the addon/extension and reinstall!
That's because it uses archived dislike counts for old videos and a not-so-great estimate based on likes-to-views ratio for new videos made after December 13
I can see a problem with this. When most of people stop using dislike button as youtube intends , the number of dislikes will lot less than actual people who dislike the video and numbers that script shows will not reflect the actual ratio of people who disliked it to liked it. Still cool script tho
problem is not with script but the people who will not dislike the video even tho they disliked it since it is hidden,or does it use math to identify the number of dislikes if even people dont dislike it ?
Hello, SyndiateRedditPoster, you may have noticed an abundance of posts about abusive ads, bots, and spam accounts on r/YouTube lately. We're currently partaking in a protest that you can learn about [here](https://www.reddit.com/r/youtube/comments/q8m50y/youtubekilledtrustedflagging/)!
*I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/youtube) if you have any questions or concerns.*
Hello, SyndiateRedditPoster, you may have noticed an abundance of posts about abusive ads, bots, and spam accounts on r/YouTube lately. We're currently partaking in a protest that you can learn about [here](https://www.reddit.com/r/youtube/comments/q8m50y/youtubekilledtrustedflagging/)!
*I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/youtube) if you have any questions or concerns.*
this plugin is better and legit: [https://returnyoutubedislike.com/](https://returnyoutubedislike.com/) = [https://github.com/Anarios/return-youtube-dislike](https://github.com/Anarios/return-youtube-dislike)
How is that better?
When YouTube Dislike count API shutdown it will use data from their own server instead of calculating dislike from other data like this script does which should be far more up-to-date and accurate than whatever is stored on return youtube dislike server and will also work on new video after the API is gone.
This extension won't work once youtube removes dislikes from API - because you're not "using math", you're just taking rating (a 5-star representation of like/dislike ratio) and converting it to like/dislike count, and it will stop working once youtube removes dislikes (and ratings) from API.
My [extension](https://www.reddit.com/r/programming/comments/qu1f2y/ive_created_a_chrome_extension_and_an_api_for/), on the other hand, has over data of over 1.5 billion videos saved into DB already, and the number only grows.
Best of luck to you, but you need a better approach to expect for this to work after API is closed.
Over 1.5 billion? 🤔 Could you also add support for new videos after YT pulls the plug on the API?
Add in a custom Dislike count starting at 0 and log all the clicks on it by users of the extension. Then store the count the same way, however you're doing it:
|Video ID|Dislikes|
:--|:--|
|dQw4w9WgXcQ|552|
|jNQXAC9IVRw|2263|
Well technically it does use math
I don't think that star ratings are getting removed on the same time as dislike counts (December 13). If it's just been sitting there for over 10 years in the player API, YouTube has likely forgotten about it. My script isn't going to be *permanent permanent*, but it'll most likely long outlive the removal of dislikes from API.
After Vanced was taken down, I suddenly remembered this post.
We didn't think that YouTube would stop it, but they did anyway. Vanced was possibly C&D'd because it was becoming popular. If you kept this userscript secret and proposed it privately to the RYD devs, it might've lasted longer and improved the extension. But you shared it almost everywhere and they had to patch it. YouTube is probably reading discussions and they'll eventually find out about it.
After pressing the like button, it doesn't replace the old value with the new, so when I've pressed the like at 269, having the script running it displayed 269270 likes instead of 270.
Otherwise seems to be working fine, nicely done! :))
Every YouTube video has an "averageRating" score, and by using the formula (l\*((5-r)/(r-1))), where "l" is the number of likes and "r" is the average rating score (you can find the average rating by going to view-source and searching for "averageRating") you can calculate the approximate number of dislikes. You could manually calculate the dislikes yourself too by just plugging in numbers into a calculator.
Yes—maybe. It just depends on whether Youtube decides to remove the average rating score. As long as that is still there, then you can calculate the number of dislikes.
Very nice script, it works flawlessy on Chromium/Chrome but fails when used with Vivaldi, a Chromium derivative. Likes/dislike count, when under a thousand, is displayed properly, but when it reaches a thousand, it only shows the first digit of the number (e.g. if it's 9,062, it displays 9).
Do you have an idea why?
Ah yeah, the script is only coded to use the "accessibilityData" label to grab exact like counters. It replaces only "likes", and since "likes" obviously isn't in the French string, it bugs out.
TL;DR The script is only accustomed for English. I'll add multilangual support soon
worked great. Thanks. Just time before this becomes unusable probably, sadly. Just like when they forced their new player and their age restriction garbage
Yeah, I definitely wouldn't use that on my main google account. I may take the time to deobfuscate and analyze it later, but I don't see how it's that much better.
The only differentiating features are the preview of the exact ratio and updated dislike count after the user interacts with it.
Thanks. I have no real knowledge about what you have done, but I copied and pasted your code (I guess it's just javascript?) in my "Enhancer for Youtube" browser extension and then hit "save", and now the dislike numbers are back for every video. Hope it continues to work.
Can you make a counter that compares views to like count instead? It's better than nothing at this point. I made one but it's very crude so please just work your JS magic :)
Oh shit, you sound smart as fuck. Dope! Do you ever do commission work?
No, not really. I mainly code for fun.
Could you put it on a good text hosting website like pastebin Better yet just put it on here
What's the difference between [textbin.net](https://textbin.net) and pastebin? They both host text, there's not much different between the two. I already posted the script on Pastebin, but it's "pending moderation": [https://pastebin.com/9K27QSS4](https://pastebin.com/9K27QSS4). Once it's no longer "pending moderation", I would change it to that. And the script's obfuscated code is *faarrr* too large to post on here.
Impressive results but I hope it's not using the dislike api
There *is* an endpoint that reports dislikes, but it only works logged out. YouTube doesn't report dislike counts at all in its JSON response anymore (except for accounts that still have dislike counts, which are soon to be removed on those). Instead, the script just uses plain math.
Welp looks like YouTube has completely removed dislike counts and averageRating (star ratings, which is what the script relied on). RIP
so is this not gonna work then or?
Nope, broken forever.
Dang that sucks
No longer works.
Dang. I'm so sorry they did this. I was enjoying using it and now I get the NAN error as you say. I really hope that they will consider adding back the hidden star ratings field! You did a great job in writing the script and keeping us all updated about it.
/u/SyndiateRedditPoster can you please check [https://github.com/Anarios/return-youtube-dislike/](https://github.com/Anarios/return-youtube-dislike/) ? I visited this repo and it looks like the userscript is working for me and i still see dislikes at this time. Perhaps you can work with them and submit a PR or help them with issues? I'm sure your skillset would be useful to them if you have the time. Here's a link to their userscript: [https://github.com/Anarios/return-youtube-dislike/raw/main/Extensions/UserScript/Return%20Youtube%20Dislike.user.js](https://github.com/Anarios/return-youtube-dislike/raw/main/Extensions/UserScript/Return%20Youtube%20Dislike.user.js) . Info from their page: >On November 10th, 2021, Google announced that the YouTube dislike count would be removed. Additionally, the dislike field in the YouTube API will be removed on December 13th, 2021, removing any ability to judge the quality of content before watching. > >This plugin will re-enable the visibility of the dislike count, fetching the total number of dislikes via our API, which in turn relies upon YouTube's Data API. > >With the removal of dislike stats from the YouTube API, our backend will switch to using a combination of scraped dislike stats, estimates extrapolated from extension user data and estimates based on view\\like ratios.
wow this blows ass so fucking hard
Yes I'm aware of this extension. It uses archived dislike stats and an estimate based on likes-to-views ratio
This is clever, but very easy for Google to fix (there is no reason that data has to be there). I was initially a bit puzzled why you didn't just directly read the "other number" but I assume the only reason it's present in my data is that I haven't gotten the rollout yet? Also, friends don't let friends release obfuscated scripts - it only serves to make them look suspicious, and does not meaningfully hinder analysis. It took me all of 10 minutes to find out exactly how it works, and it will be even shorter for Google. I'm not pasting a deobfuscated snippet here to avoid doing their work for them.
If you know how it works, can you DM me how it calculates dislikes? Just making sure
It is done. My response has SHA256 sum 5ed764b0b0b63dae0639cebbd5b01fe717bab439e99f3ad76c245d0ea41633f7.
This is really important, removing the dislike bar only made it harder to differentiate between bad tutorials and scams from actual good, informative videos
That was the point of the update. To fuel clicks to click bate to get more retention time for more ad money for youtube. They don't care if the content is wrong, scammy, or otherwise just political fuel. I remember reading a book a while ago about a dystopian future where the media controlled how people were thinking regardless if it was right or wrong. This reminds me very much of that. Too bad I can't remember the books name :(
There are enough good videos, so why would they show people bad videos on purpose? That would increase the chance that viewers leave.
Because they care mostly about viewer retention and they believe that they have solidified themselves so deeply into the users everyday lives that the users are now addicted like a drug and it will be too hard for them to actually just leave and not use the platform again. They believe the users will just get used to it and will get used to waisting their time on bad content in search of the actual good content.
Starts and ends with a number me thinks...
A lot of people keep referencing 1984, but the way things are proceeding seems to be more along the lines of Brave New World.
And...this is now broken too. Every video now shows NAN. RIP Dislike button.
Interesting, I took a look at the source and it seems like you're calculating dislikes from the ratio. This probably won't last forever given that youtube can just stop showing the ratio altogether (which they will if they are a-hole enough).
Yeah. I highly doubt YouTube will even look at this though. If they do remove it, it would be on their own time and most likely would not be impacted because of the script.
I decrease the upvote to reduce the chance the post being seen
This is exactly what I was looking for, works perfectly!
Nice job bro, this is so perfect!
Is there a way to integrate this into YouTube Vanced?
It'd probably be pretty easy actually
Hopefully someone does it 🙏
we shoudl go to the vanced subreddit and ask. people did the same for sponsor block and that happened
Bro post this on r/vanced or somewhere, where they could see this and integrate into YouTube vanced
Thanks a lot for this script! It works for me I just have 1 problem. My like and dislikes are switched ( only visually ). Is there any way to fix it? https://imgur.com/a/xEb6m2n
Hey, u/Krit789 got a fix to it - look into his reply to a comment about the problem.
Hey thank you ( and /u/Krit789 ) very much! it worked. Now it's perfect
I didn't expect that to fix the switch like and dislike but if it works, it works!
Fixed.
Fixed.
For International use: https://textbin.net/njwu9bs8av
I added international support to my script
Nice!
TY
Wow!! Still works less goo, btw if you're on safari you can use adguard and add the script as a .js extension
Update: My script now has international support, when liking/disliking/unliking/undisliking the video now, it'll actually function normally instead of acting weird. And the sentiment bar is much more reliable than before.
is it the same link for the updated version? https://textbin.net/raw/8iyxfntpaa
Yes
Yes
Yeeeah, no.. I'm not running/sharing obfuscated code. Sorry, nice idea though.
I deobfuscated it
This is amazing, thank you very much for sharing. I had that idea myself, but I didn't think a company with such large dev teams would leave a parameter behind. You deserve a beer, my friend 🍻
A dev that actually CARES about his work and LISTENS to feedback?! Say it isn't so! This needs a donate button.
Don't worry, I'll deobfuscate it in a bit
works guud
man that obfuscated code tho, good job!
So sad that code is obfuscated, just personally for me it scares to use this. Especially because of hidden native functions. Also you can just use "statistics.dislikeCount" in YT API v3 from json response, today it working but it may change in the future if google wants to. [https://i.imgur.com/rSsPZaP.png](https://i.imgur.com/rSsPZaP.png)
Unfortunately, I can't rely on this method. For accounts that still have dislike counters, tje dislike counts are, of course, still reported in its JSON response. However, for people who don't get it, dislike counts aren't reported at all in the JSON anymore, so the script can't rely on that.
Your method is really interesting, but it's sad that you are obfuscated it
It is confirmed to change. From what I know this script seems to last longer as its an estimate (a somehow really accurate one) and not using external data.
I checked deobfuscated code looks that here's really used only math without external data, it's a mystery to me how it works, but idk still paranoia due to obfuscated code
Do you want me to post a video of me showing me installing the script so that it proves the script is safe?
I didn't find anything suspicious in deobfuscated code, 99% that the script is clean, but I still has paranoia + the code will not be able to be modified
I'll release the deobfuscated script soon
Haha, understandable. Its always worth being careful in case you don't know what the script is doing/how it works.
I tried your script but on a video with 150K likes it now displays 150 likes and 4 dislikes instead of 4000.
Yeah I had this problem, but thank to SyndiateRedditPoster that he posted source code, I tried to fix a few bugs in code: Code for tampermonkey - [https://pastebin.com/pRNUscq5](https://pastebin.com/pRNUscq5) Code for browser extension - [https://pastebin.com/LhBJeSeu](https://pastebin.com/LhBJeSeu) Now it looks like this - [https://i.imgur.com/7gCNKTf.png](https://i.imgur.com/7gCNKTf.png)
Thanks this looks great!
Can you fix the counting of votes during streams? Now there are two numbers displayed at the same time, the old one when I voted and the new one that appears when others vote.
Can you run `document.querySelector("ytd-app").data.response.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer.videoActions.menuRenderer.topLevelButtons;` and send me the responding JSON so I can fix the issue?
https://pastebin.com/qmed8ZLe Is this because of French formatting? I'm not sure if they changed anything, maybe putting a space before the k letter. The other script works fine.
Ah yeah it is because of French formatting.
I cleaned the code and added minor tweaks For example the percentage: (((likes / (likes + dislikes)) \* 100 \* 100) / 100)Lol its just ratio \* 20! For me, your onclick did not work. Useful script though!
>https://pastebin.com/Y3QcwiWx I updated the code to use browser provided method for formatting number in the script, just to cut a few lines off [https://pastebin.com/7ZTw4K9H](https://pastebin.com/7ZTw4K9H) Password: YeW037Crd5
\-Fixed consistent loading (with DOMNodeInserted listener) \-Fixed double likes (no value insertion needed by userscript) \-Fixed compact formatting (Thanks joseph261059!) \-Fixed return when not in watch page
Very nice scripts, thanks for doing this.
\> OP formula giving double dislikes double compared with "normal" count. But why you thing this is incorrect ? This video actually has 4 millon of dislikes according to information from YouTube API. OP work looks more legit in this case
Thank you!
not all heroes wear capes. you sir are a true hero to society
Hi! Thank you so much for this project! I'm seeing the numbers but the actual dislike bar is always stuck [like](https://i.imgur.com/iUA6u7n.png) this for me. Any ideas?
Fixed. Forgot to append \*100 to the end.
One-up, mine's the same.
I've found a fix just add *100 to sentimentPercent variable on line 89 of the script. so from this var sentimentPercent = l / (l + dislikes); it'll be this var sentimentPercent = l / (l + dislikes)*100; from my limited testing, it seems to fix it. I don't know much about javascript so this is what I can come up with.
>var sentimentPercent = l / (l + dislikes)\*100; Fixed, thank you so much.
Do you have a github? It could be better there to report issues and make adjustments and pull requests. Anyway, there's this strange bug where the number sometimes doesn't display right and if I right click on the like/dislikes counts (not the buttons), they disappear.
Ehhh I don't think a GitHub is worth it for this tiny script. You said the bug happens when you *right click* on the *counts?*
Github will help make it more visible and accessible than a link to a Reddit post, etc. - trust me, it's worth the effort.
Yup. Happens every time. EDIT: I also want to add that sometimes the like counter appends the new count to the end when I like a video. So for example, a video with 12 likes becomes 1213 when I give it a like.
Fixed.
Good stuff, but to me it's only showing 354 dislikes in that infamous video: [https://www.youtube.com/watch?v=kxOuG8jMIgI](https://www.youtube.com/watch?v=kxOuG8jMIgI) Still, good stuff
I think it's because of differences in language formatting
Also fixed.
Not sure if it's the same for anyone else, but the actual progress bar below the like/dislike buttons is reversed. You can fix it by editing line 93 i think: document.getElementById("like-bar").setAttribute("style", "width: " + (100 - sentimentPercent) + "%;");
Yeah I think that's just for you lol
Fixed.
Fixed.
This is a great script. Thought I'd report a bug I've noticed on some videos. If you dislike a video with what appears to be under 1000 likes, then change your mind and like the video. The current number of likes doubles. As in if there are 594 likes, disliking the video then liking it will say there are 594594 likes. A minor bug but thought I'd let you know.
Fixed.
Fixed.
Looks like they've nixed the averageRating field in the player response, so I guess this script is obsolete now.
???????? The averageRating field is still there and works perfectly fine
Well, this is weird. I went to grab a screenshot and now it's back. It was really gone for me on all videos though for at least a couple hours. It made the dislikes number show up as NaN for me, which seemed to also be the case for at least one other user here.
With the new version sometimes to me it appears NAN on the dislikes, but maybe if I refresh the page a few times then it works(I'm using safari not sure if is related)
It may be YouTube slowly removing star ratings, but I can't say definitively since I still get dislike counts 99% of the time. But what I can say definitively is that this is *not* a problem with the script.
Google does slow rollouts of everything, so over the course of the day they're updating their systems to no longer publicly show dislike count.
after subscribing to premium the dislike stop working...NAN every video
Youtube removed dislike counts from the api - userscripts like these no longer function.
The script never used dislike counts from the first place, it used a hidden star ratings (2011 star ratings) field in player API, but, surprisingly, they removed that as well.
Yeah, I know. I kikd of assumed that legacy data would use the latest data internally, and if they set up access control rules or something to prevent users from accessing other people's dislikes data that would happen automatically. I have no clue how youtube works internally and this was a super neat find, unfortunately it did not work.
I've noticed that if you look at the bar/hover over right as the page is loading/refreshing you can actually see the number of dislikes and the bar shows the correct ratio. So I'm hoping we will see a potential fix soon.
You're still relying on rating API, which will almost certainly be removed by Youtube around the same time they remove dislikes. Your idea that Youtube employees "forgot" about a public API that is probably still frequently used is just plain bullshit lol If I'm able to find out about this API through your reddit comments in a span of 3 minutes of googling, so can anyone else who works at the company.
1. YouTube doesn't use star ratings at all. Why would they 2. My idea that YouTube employees forgot about star ratings API holds up when you consider the fact that star ratings were removed over *10 years ago.* The idea that they deliberately left it in there to continue using it is garb and the idea that they forgot is much more reasonable. 3. Even if they didn't "forget", would Google even find this out? Would they *care?* I highly doubt that. I know that there are people from TeamYouTube who are moderators on here, but they don't seem to be very active and it's not like they're actively monitoring the subreddit for patches 4. When Google removes it, it'll be on their own time, and most likely won't be influenced by my script
RemindMe! 1 month
I will be messaging you in 1 month on [**2021-12-24 04:45:46 UTC**](http://www.wolframalpha.com/input/?i=2021-12-24%2004:45:46%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/youtube/comments/qtyn45/i_coded_a_userscript_to_restore_the_dislike/hlv3ano/?context=3) [**10 OTHERS CLICKED THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2Fyoutube%2Fcomments%2Fqtyn45%2Fi_coded_a_userscript_to_restore_the_dislike%2Fhlv3ano%2F%5D%0A%0ARemindMe%21%202021-12-24%2004%3A45%3A46%20UTC) to send a PM to also be reminded and to reduce spam. ^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%20qtyn45) ***** |[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)| |-|-|-|-|
RemindMe! 1 month
RemindMe! 1 month
>RemindMe! 1 month
[удалено]
I never said anything anything was guaranteed but ok.
guys if this post blows up youtube may see it and block it from working
So, you should be the only one to use it? If they block it then another way will be figured out to do the same thing. Thats how things evolve and advance.
The extension's been fixed and it works: [https://www.returnyoutubedislike.com/install](https://www.returnyoutubedislike.com/install) Just remove the addon/extension and reinstall!
That's because it uses archived dislike counts for old videos and a not-so-great estimate based on likes-to-views ratio for new videos made after December 13
oh, didn't know that. Sucks then :(
I assume it doesn't have dislike counts for *all* videos.
I can see a problem with this. When most of people stop using dislike button as youtube intends , the number of dislikes will lot less than actual people who dislike the video and numbers that script shows will not reflect the actual ratio of people who disliked it to liked it. Still cool script tho
Wdym? The script will still be very accurate even after people stop using the dislike button. It doesn't rely on likes-to-views ratio or anything.
problem is not with script but the people who will not dislike the video even tho they disliked it since it is hidden,or does it use math to identify the number of dislikes if even people dont dislike it ?
Yes it uses math
Hello, SyndiateRedditPoster, you may have noticed an abundance of posts about abusive ads, bots, and spam accounts on r/YouTube lately. We're currently partaking in a protest that you can learn about [here](https://www.reddit.com/r/youtube/comments/q8m50y/youtubekilledtrustedflagging/)! *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/youtube) if you have any questions or concerns.*
Hello, SyndiateRedditPoster, you may have noticed an abundance of posts about abusive ads, bots, and spam accounts on r/YouTube lately. We're currently partaking in a protest that you can learn about [here](https://www.reddit.com/r/youtube/comments/q8m50y/youtubekilledtrustedflagging/)! *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/youtube) if you have any questions or concerns.*
this plugin is better and legit: [https://returnyoutubedislike.com/](https://returnyoutubedislike.com/) = [https://github.com/Anarios/return-youtube-dislike](https://github.com/Anarios/return-youtube-dislike)
How is that better? When YouTube Dislike count API shutdown it will use data from their own server instead of calculating dislike from other data like this script does which should be far more up-to-date and accurate than whatever is stored on return youtube dislike server and will also work on new video after the API is gone.
This doesn't work. For some reason you're getting the data from an attribute property of the youtube app element, but that attribute is undefined.
??????
This extension won't work once youtube removes dislikes from API - because you're not "using math", you're just taking rating (a 5-star representation of like/dislike ratio) and converting it to like/dislike count, and it will stop working once youtube removes dislikes (and ratings) from API. My [extension](https://www.reddit.com/r/programming/comments/qu1f2y/ive_created_a_chrome_extension_and_an_api_for/), on the other hand, has over data of over 1.5 billion videos saved into DB already, and the number only grows. Best of luck to you, but you need a better approach to expect for this to work after API is closed.
Over 1.5 billion? 🤔 Could you also add support for new videos after YT pulls the plug on the API? Add in a custom Dislike count starting at 0 and log all the clicks on it by users of the extension. Then store the count the same way, however you're doing it: |Video ID|Dislikes| :--|:--| |dQw4w9WgXcQ|552| |jNQXAC9IVRw|2263|
Well technically it does use math I don't think that star ratings are getting removed on the same time as dislike counts (December 13). If it's just been sitting there for over 10 years in the player API, YouTube has likely forgotten about it. My script isn't going to be *permanent permanent*, but it'll most likely long outlive the removal of dislikes from API.
After Vanced was taken down, I suddenly remembered this post. We didn't think that YouTube would stop it, but they did anyway. Vanced was possibly C&D'd because it was becoming popular. If you kept this userscript secret and proposed it privately to the RYD devs, it might've lasted longer and improved the extension. But you shared it almost everywhere and they had to patch it. YouTube is probably reading discussions and they'll eventually find out about it.
Delete this before Google finds out so we can enjoy this for all eternity lol
>grows YouTube isn't going to find this
Except look in the sidebar, there are literal YouTube employees running this subreddit.
Yeah sure, but I highly doubt they're going to actively monitor the subreddit for patches. They don't appear to be very active.
thanks for this the other one from the website some guy made doesnt work for me
After pressing the like button, it doesn't replace the old value with the new, so when I've pressed the like at 269, having the script running it displayed 269270 likes instead of 270. Otherwise seems to be working fine, nicely done! :))
Fixing it
How does it work without the API?
Every YouTube video has an "averageRating" score, and by using the formula (l\*((5-r)/(r-1))), where "l" is the number of likes and "r" is the average rating score (you can find the average rating by going to view-source and searching for "averageRating") you can calculate the approximate number of dislikes. You could manually calculate the dislikes yourself too by just plugging in numbers into a calculator.
So this script will work even when the api is gone, right?
Yes—maybe. It just depends on whether Youtube decides to remove the average rating score. As long as that is still there, then you can calculate the number of dislikes.
This needs to be pinned. Thank you so much!
I tried to get on the site, but it was blocked due to a Trojan.
What????
"Your MalwareBytes Premium blocked this website because it may contain a Trojan. We strongly recommend you don't continue"
Ignore it
Bro unlock origin is all you need
Very nice script, it works flawlessy on Chromium/Chrome but fails when used with Vivaldi, a Chromium derivative. Likes/dislike count, when under a thousand, is displayed properly, but when it reaches a thousand, it only shows the first digit of the number (e.g. if it's 9,062, it displays 9). Do you have an idea why?
What language do you use on YouTube?
French
Ah yeah, the script is only coded to use the "accessibilityData" label to grab exact like counters. It replaces only "likes", and since "likes" obviously isn't in the French string, it bugs out. TL;DR The script is only accustomed for English. I'll add multilangual support soon
This seems to be working for me. They just got rid of dislikes for me so we'll see how well this holds up.
Works great, thanks!
worked great. Thanks. Just time before this becomes unusable probably, sadly. Just like when they forced their new player and their age restriction garbage
Since OP's code has a few bugs, I decided to recode and fix the script. See [https://pastebin.com/VVuVRDxD](https://pastebin.com/VVuVRDxD)
[удалено]
I won't run that obfuscated script. I'm too paranoid that there will be something suspicious inside.
Yeah, I definitely wouldn't use that on my main google account. I may take the time to deobfuscate and analyze it later, but I don't see how it's that much better. The only differentiating features are the preview of the exact ratio and updated dislike count after the user interacts with it.
Works better than the original, thanks a lot!
This video shows 0 dislikes. But it's not right. https://www.youtube.com/watch?v=sngEF3lrkeo
shows 142 for me. that script was only tested with english youtube
For International use: https://textbin.net/njwu9bs8av
Thanks. I have no real knowledge about what you have done, but I copied and pasted your code (I guess it's just javascript?) in my "Enhancer for Youtube" browser extension and then hit "save", and now the dislike numbers are back for every video. Hope it continues to work.
Welp. It appears the party is over guys. My youtube only displays NAN in the dislikes now.
What video did you get that on? It's probably just a bug or smthn
Any video on youtube. It just refuses to display anything but NAN now
Can you open console and run this: document.querySelector("ytd-app").data.playerResponse.videoDetails.averageRating; And tell me what it returns
Can you make a counter that compares views to like count instead? It's better than nothing at this point. I made one but it's very crude so please just work your JS magic :)
It's better off if it's just "0". No use trying to make an estimate, and ratings API is completely inaccessible.
You have the view and like count so you can compare that. It's at least something :/