anarios / return-youtube-dislike Goto Github PK
View Code? Open in Web Editor NEWChrome extension to return youtube dislikes
Home Page: https://returnyoutubedislike.com/
License: GNU General Public License v3.0
Chrome extension to return youtube dislikes
Home Page: https://returnyoutubedislike.com/
License: GNU General Public License v3.0
Brave
1.32.106
Extension
0.0.0.6
https://www.youtube.com/watch?v=E7YhB7iG4dM
Dislike count is displayed even when visibility of like count is disabled in youtube studio.
It seems that in that case its value is always 0, so it's useless anyway.
As the dislike count is saved and cached for all videos, is the count updated for newly published videos? Such videos get more dislikes over time, so I wanted to ask if the backend of this extension rechecks the dislike count after a cooldown for example.
If not, that could be implemented like this:
Firefox
94.0.2
Extension
latest
no
Should be marked with license correctly on addons.mozilla.
Both
I want to suggest open-sourcing the backend so that people can self-host it and also maybe contribute to it.
Release the source code on GitHub
Update the Discord Invite Link on returnyoutubedislike.com.
Would it be possible/within scope to add this extension to Firefox for android? It seems to be currently unavaliable.
Hi, I've tried using your UserScript code in Tampermonkey on Microsoft Edge (version 95.0.1020.53 64-bit version) and it doesn't work.
Tried figuring out why it doesn't and discovered that getButtons() method returns component from wrong container
That component is not displayed on screen, the displayed one is
Changed id method getButtons() looks for from menu-container to actions-inner and everything works for me.
Both
Incrementally archive dislike counts and store them into some kind of permanent storage.
Alternatively use archive.org or similar websites to retrieve dislike count.
When youtube pulls the killswitch for the dislike API completely, we won't rely on them, rather use archived and our own data.
No response
Both
Please add that on every thumbnail in suggestions, main, subscriptions, etc., there is a bar immediately visible with the ratio of paws up and down. :D
Simply capture each item with a thumbnail on a given YouTube subpage, retrieve the video id, generate a bar with the ratio of paws up and down and add under each thumbnail.
Both
As can be seen here currently the API receives the video id. In current SponsorBlock their API gets a hash prefix of the video id which improves user privacy.
SponsorBlock hash is a mix of SHA-256 and hex iterated 5000 times, then it crops the first 4 characters and send to the server. While using the same idea because it was already being tested, I think using PBKDF2 is better instead of using a for loop because it allows way better security because PBKDF2 is way more used than this for loop construction, because it's more optimized (it ran up to 37 times faster in my tests, keeping the same loop count; I think the issue with SponsorBlock code is that WebCrypto is slow when iterated due to it depending on promises) and because it is the only PBKDF available in WebCrypto.
I can work on the second point only as I could not find the source code of the API. Using the userscript code as reference I think I just need to add a function that calls window.crypto.subtle.deriveBits
with the video id and return the hash prefix, then make setState()
call this function before calling doXHR()
. I think that the changes in the extensions are similar. The only caveat I can imagine from this approach is if WebCrypto is not available in userscripts or extensions in some browser. If some browser have this issue then I think the fallback would be sending the video id as it currently works, as using a pure JavaScript implementation would be too slow, which is not desirable.
Userscript
update function
No response
Hello! Appreciate the initiative (^^)
The extension isnt supported on Firefox for Android(cannot confirm for iOS).
Tamper monkey isn't available for mobile either.
Are there plans to support this extension for mobile platforms? If not, what are our options
Thank you for this project, have a great day (^^)
Script
Tampermonkey 4.13 reports:
"eslint: null - parsing error: unexpected token" on the line 21:
"?.querySelector("#top-level-buttons-computed");".
Extension
When I try to "load unpacked" the folder into which I extracted the contents of the zip, Chromium reports:
"Invalid value for 'web_accessible_resources[0]'."
"Could not load manifest."
Chromium v78 is maybe kinda old (sorry), but it would be cool if you could make it work without update. I do have the latest version of Tampermonkey, I think (Tampermonkey v4.13).
Google Chrome
Version 96.0.4664.45
Extension
v0.0.0.9
https://www.youtube.com/watch?v=AdUw5RdyZxI
When watching a live video, when the dislike count updates it appends the new count onto the previous count. So you end up with numbers like '2.5K2.4K', or really huge numbers if it's below 1K.
Start watching the video I linked, then wait a bit for the count to update.
Both
There needs to be a way to prevent this script from running on unlisted or private videos.
This is a large privacy issue that can be fixed by checking the page for a private or unlisted badge before using the API.
Below is an unoptimised function that checks if a video is private or unlisted.
function CheckPublic() {
for (var i = 0; i < document.getElementsByClassName("ytd-badge-supported-renderer").length; i++) {
if (document.getElementsByClassName("ytd-badge-supported-renderer")[i].textContent == "Unlisted" || document.getElementsByClassName("ytd-badge-supported-renderer")[i].textContent == "Private") {
return false;
}
}
return true;
}
Firefox
89.0
Extension
1.0.0.0
Any video: https://www.youtube.com/watch?v=By_Cn5ixYLg
Both
Many content creators have already shown their disapproval of the removal of the public dislike counters on YouTube. However, the data is and will remain visible to creators themselves.
Therefore I thought it'd be a good idea to somehow integrate these private statistics into the public database.
From December 13th onwards, return-youtube-dislike will be using their own database (amongst other techniques) to display the like/dislike ratio.
As YouTube stated in an email regarding the removal of the public discount field; the statistic will still be visible to an authenticated user who owns the video itself:
The dislike_count field within the statistics part of the video resource will be omitted on calls to the video.list endpoint except in cases in which the request is being authenticated as a user (such as the creator or the agent user) who owns the video that is being requested.
My proposal is as follows:
A content creator would, via a locally running client application that interfaces with the YouTube API, automatically submit their results to the return-youtube-dislike database periodically. This application would obviously be open-source and not submit any other non-relevant statistics to the database to protect him/her.
The statistic would subsequently overwrite/merge with the database or other methods of acquiring the like/dislike ratio as long as the data is not severely outdated. This is just an example, I haven't yet thought about how the data would be processed.
I'm curious if something like this would be picked up by creators.
I think the idea is sufficiently simple to implement that it is worth putting time into this.
In the readme:
[The] dislike field in the YouTube API will be removed on December 13th, 2021
... then later:
our API [...] relies upon YouTube's Data API [...] YouTube might prevent this in the future
So I'm confused, why do you say YouTube 'might' prevent using the data API even though they have stated they will remove the dislike field. Is the API different to the normal one or are you not relying on the dislike field and instead some other metric?
Both
It would be great if the user input was incorporated in the counter...
EX; Press dislike, dislike counter goes up by one.
No response
Firefox
Firefox 84.0b8
Extension
0.0.0.8
https://www.youtube.com/watch?v=ussCHoQttyQ
I know this may be a low priority and niche but with the Use green/red colors for likes/dislikes bar and Recreate old video page layout options on the Youtube Redux Addon, this addon overrides the layout and colors and makes it look awkward. If you can, maybe have an option to have youtube redux override the looks of this plugin is possible. Thanks
Opera
81.0.4196.54
Userscript
0.0.0.7
https://www.youtube.com/watch?v=s4-gMgdsnHQ
Sometimes when I open video it have ratio bar stuck on default position.
After updating browser to versions 81.X bug is happening quite rarely but previous versions suffer from this.
If it's opera bug (I think so). Users just need to update to newer version.
Awesome work on this extension, looks interesting.
How do you intend to mitigate against spoofing of votes? Someone could quite easily spam the API and simulate votes
Its always best to add a license file early, before contributions get out of hand, and you lose ability to license code-base.
I always go with MIT, but you may prefer something else.
Both
That said, that YouTube will probably remove their API requesting feature for dislike quantity, and if so, any API-based extension will fail when that happens. So, storing video ids alongside with their dislike quantity may be a solution.
I understand this is very presumptuous request and if you decide close it at once. I doubt you can obtain IDs of profiles from which dislikes where put(for better accuracy), so even theoretically there be could only raw amount of dislike count, adding with own count from your extension on top of that(more accurate - unique count from recorded users ids list, way less accurate - just adding "+1" to current one). That should be not so hard for someone familiar with server-side database coding, but sadly I'm not and can't contribute on that. Also obviously the whole idea could possibly work only if people will be willing for donating for servers rent and maintaining(not saying the work needed to be done for that).
I wish that YT will not modify their API but I doubt they willn't. And when that happens your extension is gonna broke anyway, so its either you will try to maintain it while you can(which is also great and appreciating) or add server to it and make it outlive API removal.
It's just a suggestion, you are free to decline it if you know you couldn't have desire for all of that. But if you could, I think there would be very many people who appreciate this)
we need independent comment/like browser extension. channels and site owner changing or delete users comments.
disqus.com is not easy every domain and url.
what about think url based comment plugin?
Webhook test
Google Chrome
Chromium v95
Extension
0.0.0.7
extension not working after clear data browser
A bug happened! extension not working after clear data browser
Before removing dislikes, youtube was displaying exact (to integer) number of likes/dislikes when ratio bar was hovered.
Both
Please can you use GitHub releases for artifacts (ZIP, CRX, XPI, user.js) for the versions of this extension? Currently, the Mozilla store is refusing to install the XPI in Firefox saying "This extension is corrupt", and it would be easier if it was available here.
Tag releases as they are on the website using Git, and upload compiled/packaged code under the release tags section on GitHub.
I potentially could help work on this, though I am still a Git rookie, but need to double-check the build/packaging process, and I believe it needs write-access to the repo.
In README.md file under What it Does heading it is stated that YouTube will remove dislikes count from its api but it does not says why.
Userscript
Qutebrowser supports greasemonkey much better than whatever u guys are doin. I spent about 15-20 minutes fiddling around and I can't get the userscript workin
No response
Userscript
It would be nice if the extension changed the dislike counter for Invidious and/or piped. They are a private way of accessing youtube and it would be nice to have this support.
We can implement it by scanning for the watch?v= ID and then just grabbing the dislikes counter for that video, then changing the dislike element for the watch page on each of the respective sites.
Firefox
94.0.2
Userscript
last
A bug happened!
Tampermonkey script show 8 dislikes
Firefox add-on 586 dislikes
Extension
Can you add Microsoft Edge Extension?
idk
I have loaded the package and temporarily disabled all the other extensions, yet im still getting this error.
Seems to be brave only, as loading in the package on microsoft chrome worked and the dislikes showed.
Firefox
Firefox 94.0.2
Extension
1.0.0.0
https://www.youtube.com/watch?v=5KBqOfv-8HI
After disliking, the number was shown twice (was 861 before):
This will provide backward compatibility for people using older browsers, I don't know why people will be using old browsers but it adds some support for them.
Thoughts?
I'm using an AppStore app called UserScripts to inject JS into the page. It does so, but for some reason the dislikes are nowhere to be found. In the Dev Console I see ReferenceError: Can't find variable: GM. No other extensions are installed, so I am unsure as to what causes the error
N/A
N/A
Extension
N/A
N/A
N/A
Brave
Version 1.32.106 Chromium: 96.0.4664.45 (Official Build) (x86_64)
Userscript
0.5
Firstly, the script did not seem to detect when the page had finished loading.
I was able to fix it by changing this line from
if (getButtons()?.offsetParent && isVideoLoaded()) {
to
if (getButtons() != null && isVideoLoaded()) {
I have no idea experience with .offsetParent
and thus have no idea if this change would be acceptable or not.
I also haven't used this extension for all that long and thus can't guarantee that it won't break under certain conditions or work on other browsers.
After I managed to fix the bug above, I noticed that the getButtons() function could not find the actual button and instead returned a bunch of seemingly invisible yet identical elements.
This was fixed by replacing
return document
.getElementById("menu-container")
?.querySelector("#top-level-buttons-computed");
with
return document.getElementById("top-level-buttons-computed");
Once again I have no idea if this change would be acceptable or not, but I assume that both bugs are caused by the use of optional chaining.
Both
Most content creators also disagree with the removal of the dislike button. Wouldn't it be a good idea to give content creators the option to share their dislike amounts automatically when they open the analytics on YouTube Studio?
This would have to be an opt-in future. I reckon it would be a good idea to ask new installers whether they want to share that data or not when they first open YouTube Studio with the extension/script installed to make sure people are aware of the feature.
This is a low priority feature as it can take a while to implement this. But once YouTube stops sharing the numbers in their API, methods of collecting data such as this are vital to ensure the quality of predictions remain high.
We can check if a user is on creator studio and determine which video they are analyzing by checking the URL.
https://studio.youtube.com/video/VIDEOID/analytics/tab-interest_viewers/period-default/explore?entity_type=VIDEO&entity_id=pYRMBktRcjM&time_period=since_publish&explore_type=TABLE_AND_CHART&metric=LIKES_PER_LIKES_PLUS_DISLIKES_PERCENT&granularity=DAY&t_metrics=LIKES_PER_LIKES_PLUS_DISLIKES_PERCENT&t_metrics=RATINGS_LIKES&t_metrics=RATINGS_DISLIKES&dimension=VIDEO&o_column=LIKES_PER_LIKES_PLUS_DISLIKES_PERCENT&o_direction=ANALYTICS_ORDER_DIRECTION_DESC
<div class="value-container layout horizontal end-justified style-scope yta-explore-table-row"><div class="value debug-metric-value style-scope yta-explore-table-row">0</div><dom-if restamp="" class="style-scope yta-explore-table-row"></dom-if></div>
When a user does not inspect the Likes amount we can determine the amount of dislikes by calculating them from the Likes percentage on the main video analytics page which looks like this:
<div class="percentage style-scope yta-table-card" style="width:100%;background:rgba(235, 93, 166, 1);"> </div>
Brave (But should happen on all browsers)
Version 1.31.91 Chromium: 95.0.4638.69
Extension
v0.0.0.9
https://www.youtube.com/watch?v=YbJOTdZBX1g
function numberFormat(numberState) {
const userLocales = navigator.language;
const formatter = Intl.NumberFormat(userLocales, { notation: "compact" });
return formatter.format(numberState);
}
This function rounds the numberState
This happens to be an issue on videos (notably being the video I attached) showing more dislikes than what there actually is. Open the video above with the extension and it will show 20M dislikes, if I open the same video (dislike still isnt removed for me) youtube displays it floored.
If theres something you can pass to the options to prevent this for happening then do that (i checked the docs and couldnt find anything)
Alternatively you can code a function to floor it and then pass it.
I can work on it
One alternative to extrapolation would be for the app to use its own voting system. In a nutshell, the app would provide its own "like" and "dislike" buttons. Users who register an account would be able to use this feature. In addition to scraped data from YouTube, the app would also display "like" and "dislike" data collected from the app's users.
Of course, the downside is that it might cost a lot to run this service in the event that it becomes popular.
Hi, the current version 0.0.3 is not working on chrome after installed in developer mode, but it works on Firefox. Perhaps you could check what was wrong, thanks.
Given the API will be closed by middle of December, what do you think about beginning to crawl youtube to build up a database of historical dislikes?
Both
Avoid replacing the dislike counter if the user still can see the dislike count by itself.
Just check if the text is "Dislike" than some kind of number? Maybe also check if the like count also have the "Like" text to solve #47. I think there is a object that contains the translated strings that you can refer.
Is it possible to Add a machine learning api that would see YouTube comments and further help in refining things
@Anarios
(I am ready to help in production , hit me up)
Firefox
Firefox 93.0
Extension
0.0.0.9
https://www.youtube.com/watch?v=g2p4P36VtQE
This may be to do with how where i am dislikes haven't yet been removed, here is an example on the video linked above as you can see there are two ratio bars rather than one
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.