Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google has dropped the dislike count, thanks for the great extension! It was very helpful over all of these years 🥇 #50

Open
NeveHanter opened this issue Nov 10, 2021 · 56 comments

Comments

@NeveHanter
Copy link

NeveHanter commented Nov 10, 2021

More info: https://support.google.com/youtube/thread/134791097/update-to-youtube-dislike-counts
Relevant HN discussion: https://news.ycombinator.com/item?id=29177091

@Nornec
Copy link

Nornec commented Nov 10, 2021

Also according to the post, devs can apply for an exemption. This is overall a bad move for the platform in my opinion, all things considered.

@braham-snyder
Copy link

Could this extension switch to the likes-to-views ratio?

(As "gpt5" mentions in those HN comments.)

@MmyGgithubAaccount
Copy link

MmyGgithubAaccount commented Nov 10, 2021

You can apply for an exemption (to have dislike data on non-authenticated calls) as long as you don’t display or share dislike data with end your users.

Since this extension does do both of those things, I doubt it'll quality for an exemption

@Nornec
Copy link

Nornec commented Nov 10, 2021

I just attempted the exemption form and it seems the only way to get an exemption is to be an organization with a specific internal app that does not expose the data to anyone but a sole user or set of internal users. It also requires that a data compliance audit be done on every applicable project, but this compliance seems to, again, only apply to organizations and not sole developers. This stinks..

@ryanbuening
Copy link

ryanbuening commented Nov 10, 2021

I think a likes-to-views ratio indicator would be the next best thing here if dislike counts are being removed.

@mat926
Copy link

mat926 commented Nov 10, 2021

Youtube/Google themselves are a joke.

@elliotwaite
Copy link
Owner

@NeveHanter, thanks for letting me know about this, and thanks for the kind words.

@Nornec, yep, looks like exemptions are only supposed to be for projects that don't share dislike counts publicly.

Could this extension switch to the likes-to-views ratio?

(As "gpt5" mentions in those HN comments.)

@braham-snyder and @ryanbuening, yes. I'll start implementing this as an optional alternative for now so we can try A/B testing it to see if we can tune it to be useful since it might need some kind of exponential/log scaling factor to work well. I'll comment here when that update has been released.

@Greedquest
Copy link

@elliotwaite I just wonder whether there's a bit of a loophole; given we each use our own API key, it's perfectly possible we all just happened to clone this project and are working on it independently - and so there aren't really end users per-se because each one of our API calls will not be viewed by any other App user. Basically could devs still use it for WIP projects, if they are the sole user of that particular API key.

@elliotwaite
Copy link
Owner

@Greedquest, interesting idea. I wonder if personal use would qualify as a valid use case. If anyone wants to try this, here's a link to the application form: Developer Exemption Application Form.

The form also mentions:

An exemption will not be granted until your API Project passes a compliance audit, so if you have not passed a compliance audit, please start this process immediately.

I tried to pass a compliance audit for this extension in the past and they would take months in between replies and ask me to submit redundant data, but maybe their communication has improved since then. I'm going to pass on trying this option since my probability estimate for success is so low that it seems like a waste of time, but if anyone else wants to try this, I'd be interested in hearing what YouTube's response is.

@elliotwaite
Copy link
Owner

I just released an update (version 1.5.0) which adds the option to try the "Likes-to-Views" option, as well as a "Both" option for A/B testing:

Screen Shot 2021-11-11 at 2 00 26 AM

This is the current formula (it was the best I found so far), but the a and b values may need to be tuned:

likesToViews = likes / views
a = 30
b = .2
score = 1 / (1 + Math.exp(-a * (Math.pow(likesToViews, b) - 0.5)))
percentage = 100 * score

The likesToViews get exponentiated (b), shifted (- 0.5), scaled (a), and then fed through a sigmoid. You can see what this formula does and how tuning a and b would affect the output with this Desmos graph (the x-axis is the likesToViews, and y-axis is the output score between 0 and 1).

There does seem to be some correlation between the likes-to-views and likes-to-dislikes (especially with the "Exponentially scale the rating bar" option turned on, which currently only affects the likes-to-dislikes rating), but they can also differ a lot sometimes. It's definitely a different metric, but interesting in its own unique way.

Also, this update didn't change any of the tooltip text, which still only shows likes-to-dislikes info.

Let me know what you guys think.

@ShadowTheAge
Copy link

ShadowTheAge commented Nov 11, 2021

Exemption is pointless because without public dislikes people wouldn't use dislikes like they use now. Why make an action if it isn't going to change anything?

@ryanbuening
Copy link

I compared Likes-to-Dislikes vs the Likes-to-Views formula and it seems very hit or miss so far. Bottom bar is Likes-to-Views.

image

image

image

@elliotwaite
Copy link
Owner

I compared Likes-to-Dislikes vs the Likes-to-Views formula and it seems very hit or miss so far. Bottom bar is Likes-to-Views.

@ryanbuening, yeah, it might be more of an engagement rating rather than the normal likes rating.

Also, videos that are run as ads will probably have low engagement. I saw this one in the trending section and it has very few likes (2,688) given its total views (1.2M), so I'm guessing Amazon ran it as a YouTube ad.

Screen Shot 2021-11-11 at 6 48 44 AM

@ShadowTheAge
Copy link

ShadowTheAge commented Nov 11, 2021

Train some machine learning construct that guesses the amount of dislikes based on the amount of likes, views and comments and video length? While we still have access to the data

@Greedquest
Copy link

Greedquest commented Nov 11, 2021

@ShadowTheAge So reimplement YouTube's video suggestion algorithm! I mean that's basically what this extension is for, to allow you to pick the videos you want to watch based on community approval.

@ryanbuening Yeah, it is more of an engagement metric. Music videos for example will have most people just playing it in the background or autosuggested, less likely to interact with it. Or a 3 hour tutorial probably is watched once and never again so people won't remember to go back and like that video they watched over and over again.

@Greedquest
Copy link

@elliotwaite Another interesting thing to see would be Likes : Comment count (likes on video per comment) - since both of these are positively correlated with "engagement" dividing one by the other could cancel that factor out. They are also both proportional to views, so dividing one by the other gives a dimensionless metric independent of view count (just like likes/dislikes).

Tl;Dr:

Comments  ∝ TotViews * Engagement  (i.e. Comments increase with both "engagement" and number of views)
Likes     ∝ +veViews * Engagement
Dislikes  ∝ -veViews * Engagement
(TotViews = +veViews + -veViews)

∴

Likes / Dislikes ∝ +veViews / -veViews                (what we had before)
Likes / Views    ∝ +veViews * Engagement / TotViews   (what we have now - meaning it varies with video engagement as well as positive reception)
Likes / Comments ∝ +veViews / TotViews                (proposal)

@Leopold702
Copy link

Someone should create an independent dislike database + browser extension that will work on the same principle as SponsorBlock. It might be even possible to fetch and archive the current dislike counts, since API should remain working till December 13th.

@elliotwaite
Copy link
Owner

Train some machine learning construct that guesses the amount of dislikes based on the amount of likes, views and comments and video length? While we still have access to the data

@ShadowTheAge, interesting idea. Perhaps just a standard sentiment analysis model would work, even if it's not trained to predict the likes-to-dislikes rating. It could show the average of some number of the top comments. I may try that at some point, but it would take a bit of work to implement.

Someone should create an independent dislike database + browser extension that will work on the same principle as SponsorBlock. It might be even possible to fetch and archive the current dislike counts, since API should remain working till December 13th.

@Leopold702, that could potentially work too. If the extension gained enough users (reached the critical mass point in network effect terms), maybe even just showing the likes/dislikes of only the people who use the extension would be useful. But that might require a lot more users. I might try that too, but this would also require a bit of work to set up.

@elliotwaite
Copy link
Owner

@elliotwaite Another interesting thing to see would be Likes : Comment count (likes on video per comment) - since both of these are positively correlated with "engagement" dividing one by the other could cancel that factor out. They are also both proportional to views, so dividing one by the other gives a dimensionless metric independent of view count (just like likes/dislikes).

@Greedquest, interesting idea. I just added this option (Likes-to-Comments) in version 1.5.2, as well as some options to A/B test it against the others.

The current function used is:

likesToComments = likes / comments
a = 0.15
score = 1 - Math.exp(-a * likesToComments)
percentage = 100 * score

And here's the Desmos graph for that function.

This one is interesting too. From looking at how it scores Shorts, it may give them a slightly higher rating, maybe because people watching Shorts are more likely to just like and swipe to the next one rather than also leave a comment, but even if that is true it might not be an issue.

Let me know what you guys think about this one.

@Gaeriel
Copy link

Gaeriel commented Nov 12, 2021

For me, what almost always gives me good results, is max(LtV,LtC) with the constants you're using now. Other constants might give better results, but I don't know how to test that.

Sometimes, neither work very well, I believe that's mostly with channels that incite discussions (PBS Space Time is an example). I believe that could be solved by not using the number of comments, but the number of commenters, but I suppose that data is not easily available?

Also: the ratio should also be shown on the video page, not only on the thumbnail, although I seldomly look at the ratio after I click on a video: that's what this extension is for :)

@Greedquest
Copy link

Greedquest commented Nov 13, 2021

@Gaeriel yeah number of commenters rather than comments is a good shout, as like votes are one per user. Looking at the docs, unique commenter count is not one of the v3 api endpoints so it would probably require manual iteration over all the comments accumulating by user id, so could take a few minutes per video (a bit more complex to implement in a performant way than the current statistics but not impossible with some caching).

Alternatively I guess if number of unique commenters is proportional to engagement, and comments per user is also proportional, then maybe total comments are actually proportional to engagement squared. In which case a statistic like Likes^2 / (Comments * TotViews) might have better dimensions. At this point some dataset and graphs might be nice :)

@Marfa
Copy link

Marfa commented Nov 13, 2021

There's Tampermoneky script. It works through YouTube Data API key. However I don't understand how it gets dislike count, I'm not programmer.

And there's TODO "Real count", so...

@Gaeriel
Copy link

Gaeriel commented Nov 13, 2021

However I don't understand how it gets dislike count, I'm not programmer.

It looks like he uses the API to get it, so it won't work after December 13

@Gaeriel
Copy link

Gaeriel commented Nov 15, 2021

I found this on r/youtube : https://old.reddit.com/r/youtube/comments/qtyn45/i_coded_a_userscript_to_restore_the_dislike/?ref=share&ref_source=link

He claims an almost 100% accuracy of reproducing the dislike count, but his code is obfuscated, so I have no idea how he does it. It might be worth contacting him.

@elliotwaite
Copy link
Owner

I found this on r/youtube : https://old.reddit.com/r/youtube/comments/qtyn45/i_coded_a_userscript_to_restore_the_dislike/?ref=share&ref_source=link

He claims an almost 100% accuracy of reproducing the dislike count, but his code is obfuscated, so I have no idea how he does it. It might be worth contacting him.

@Gaeriel, thanks for sharing. I am skeptical but open to being proven wrong. Is there a way to test out if that code actually works prior to YouTube actually removing the dislike info?

@Gaeriel
Copy link

Gaeriel commented Nov 15, 2021

I'm skeptical too and I don't trust obfuscated code.
I can think of no way of testing if it works without the dislike info in the API response, except for reverse engineering it. I tried a de-obfuscator, but it's still very obfuscated :)

@elliotwaite
Copy link
Owner

I'm skeptical too and I don't trust obfuscated code. I can think of no way of testing if it works without the dislike info in the API response, except for reverse engineering it. I tried a de-obfuscator, but it's still very obfuscated :)

I looked into deobfuscating it too. It looks doable but would probably take a while. For now, I'll wait till YouTube actually removes the dislikes to see if that code still works before pursuing this option further.

@Gaeriel
Copy link

Gaeriel commented Nov 16, 2021

he deobfuscated it :)
https://textbin.net/8iyxfntpaa

Ok, so apparently there's still a ratio available on the page for the video:

document.querySelector("ytd-app").data.playerResponse.videoDetails.averageRating

He calculates the dislikes using that ratio and this formula:

Math.round(likes*((5-ratio)/(ratio-1)))

@marvellz
Copy link

Hi, guys.
There is a given solution: https://github.com/Anarios/return-youtube-dislike
Maybe collaboration 🤔

@Anarios
Copy link

Anarios commented Nov 16, 2021

@elliotwaite, will be happy to colab.

@elliotwaite
Copy link
Owner

@elliotwaite, will be happy to colab.

@Anarios, awesome. The plan that I'm currently considering is to get as much data as I can on past videos, then figure out a good way to predict dislikes based on that data (maybe a simple function, maybe a small neural network if needed), then also add a login for users so that I can track their likes/dislikes if they are logged in. Then make an API that can be called by logged-in users that will combine all of that (past data, user data, prediction model) to get a dislike estimate for specific videos.

It seems like your planned strategy is similar. I'm not sure what the best way to collab would be, but let me know if you have any ideas.

@Anarios
Copy link

Anarios commented Nov 16, 2021

At least sharing user-generated dislike data to avoid fragmentation is a must.

@elliotwaite
Copy link
Owner

At least sharing user-generated dislike data to avoid fragmentation is a must.

I have some concerns about sharing user data as the Chrome Web Store's Developer Program Policy seems to be pretty strict about it.

@elliotwaite
Copy link
Owner

Some are speculating that YouTube might actually not follow through with the change, but it looks like it's just speculation at this point:
YouTube appears to backflip on controversial dislike removal announcement

@ajayyy
Copy link

ajayyy commented Nov 17, 2021

If you haven't seen, this is what I'm working on ajayyy/SponsorBlock#1039

I have some concerns about sharing user data

It should be fine sharing data when it's just the number of upvotes and downvotes per video, as that is not "user data". My plan was to always have explicit consent, ie. the user must click a submit button after clicking YouTube's button, so they can choose not to submit likes on some videos.

@elliotwaite
Copy link
Owner

elliotwaite commented Nov 17, 2021

If you haven't seen, this is what I'm working on ajayyy/SponsorBlock#1039

@ajayyy, thanks for letting me know. It looks like you are considering building a new extension to address the likes/dislikes situation. Your SponsorBlock extension has a lot of users, so your new extension might become the go-to one for crowd-sourced ratings. If your new extension makes this extension obsolete, I'm okay with that. Feel free to use any of the code in this repo if you want. Or if this extension could call into your API, maybe that would work too, and then I could advertise to my users to install your extension to contribute to your likes/dislikes database.

It might also be good if I try to create my own API solution as well so that users could test out both to see if there are benefits to doing it one way over the other. Perhaps they would be complimentary, or maybe users would just converge to one of them.

I mainly just want users to be able to see a useful rating bar on each video thumbnail in a way that is a good user experience. Whether that's through this extension or yours or a combo of the two is fine with me.

@elliotwaite
Copy link
Owner

@Anarios and @ajayyy, I'm thinking of adding an option to this extension to let users choose which backend likes/dislikes API to use. If you are both building APIs, I'd like to add both of your APIs as options. Would this work? If so, how can I call into your APIs?

I also have a collection of recent public YouTube likes/dislikes data that I could share with both of you if you could use it.

Also, feel free to DM me on Twitter if you'd like to discuss anything privately: https://twitter.com/elliotwaite

@ajayyy
Copy link

ajayyy commented Dec 1, 2021

Here is the API docs for the one I am working on: https://wiki.sponsor.ajay.app/w/API_Docs/Ratings

No front-end exists for it yet, but it should still work right now.

The extra reporting categories described in ajayyy/SponsorBlock#1039 (comment) are not implemented yet, but they will be added in a backwards compatible way.

@elliotwaite
Copy link
Owner

@ajayyy, thanks for the info. Would it be possible to add batch request support, similar to how the YouTube API does it, where it allows the video ID field to be a string of comma-separated video IDs (up to 50 per request)? So with your API, perhaps it would allow the prefix value to be a string of comma-separated video ID hash prefixes.

Also, for the video IDs I tried, I only get an empty array returned. Can you recommend a video ID that you have stats for in your database that I can test against?

@Anarios
Copy link

Anarios commented Dec 3, 2021

http://returnyoutubedislikeapi.com/swagger

here is mine. Main thing that you want is GET /votes?videoId

It's rate limited by IP though.

@ajayyy
Copy link

ajayyy commented Dec 3, 2021

@elliotwaite Added a bulk fetching API

Example (most network libraries can convert from array to repeated parameter):

https://sponsor.ajay.app/api/ratings/rate?prefix=6745&prefix=5f6b

or

https://sponsor.ajay.app/api/ratings/rate?hashPrefixes=["6745","5f6b"]

[
  {
    "videoID": "jNQXAC9IVRw",
    "hash": "67454704342df24de2d91fae262fc75b3c9735d45135a6273239d4e68037d15c",
    "type": 1,
    "count": 1
  },
  {
    "videoID": "dQw4w9WgXcQ",
    "hash": "5f6b0b4e201f2a7e66927abb5cadeec81624dcc8efe6644b78aa182213f653a2",
    "type": 1,
    "count": 1
  }
]

Since I haven't finished the front-end yet, there isn't any data in the DB except for the example videos I linked.

@elliotwaite
Copy link
Owner

@ajayyy, okay, thanks. That should work for now.

@elliotwaite
Copy link
Owner

http://returnyoutubedislikeapi.com/swagger

here is mine. Main thing that you want is GET /votes?videoId

It's rate limited by IP though.

@Anarios, thanks, looks good. Would you be open to adding support for batch requests? My extension often needs to request data for many videos at a time (usually around 30 to 70). One way it could be implemented is to allow videoId to be a string of comma-separated video IDs, in which case (if a comma is detected in the string) it would return an array of data for those IDs. And you could cap it at 50 IDs per request or something.

@elliotwaite
Copy link
Owner

elliotwaite commented Dec 3, 2021

@Anarios and @ajayyy, have either of you considered this idea for your extensions (sorry if this isn't new or if you are already planning to do this):

  • Allow users to log into your extension if they want to contribute to your DB.
  • Then, anytime a logged-in user visits a video that they have already liked/disliked, or anytime that user actively likes/dislikes a video, the extension could recognize that and store that like/dislike info for that user in your DB (or if they unlike/undislike a video, you could remove that data from your DB).

This data could then be used to help extrapolate the real stats. For example, if a video has 80 likes and 20 dislikes in your user DB, and the actual video has a total of 800 likes, you could estimate it also has 200 dislikes. Also, the login requirement would help prevent people from abusing the API since each user could only like/dislike a video once.

@elliotwaite
Copy link
Owner

I updated the extension (version 1.6.x) to use the Return YouTube Dislike API. The Chrome version is going through the review process and the Firefox version is already available.

@ajayyy, I can add your API as an option as well once it's ready.

@MichaelMMasi
Copy link

@elliotwaite For many years, I have considered this extension to be a critical component to maximize Youtube viewing experience & productivity. I have been meaning to create an account here to praise and thank you for you work for some time.

I was dismayed when I heard the news that Google would be removing dislikes from Youtube.

I'm thrilled to see that you are still working to get around the new limitations and continue to provide an extension that at least mimics and substitutes the like/dislike ratio with something that serves a similar purpose. (I thought this would surely be the end of the road for the extension).

Thanks!

@elliotwaite
Copy link
Owner

@MichaelMMasi, thanks for the comment!

@elliotwaite
Copy link
Owner

The Chrome version is now available. After the update, you may need to approve the updated permissions to reenable the extension. The new permissions enable making API calls to returnyoutubedislikeapi.com.

@elliotwaite
Copy link
Owner

The new API is rate-limited by IP address, so let me know if any of you are running into rate-limiting issues, such as the rating bar not being added to some of the thumbnails.

Right now the extension caches ratings for the lifetime of the tab session, meaning that if you browse YouTube in the same tab without refreshing the page, any thumbnails that you come across for a second time will just use the cached rating instead of making a new API call. However, if you refresh the tab, or open a new tab, the cache for that tab is reset. But if needed, I could also enable a global cache across all tabs that is time-based, which might help further reduce the number of API calls.

@Saxayone
Copy link

Saxayone commented Jan 7, 2022

The new API is rate-limited by IP address, so let me know if any of you are running into rate-limiting issues, such as the rating bar not being added to some of the thumbnails.

I have been a number of times now =/

However, if you refresh the tab, or open a new tab, the cache for that tab is reset. But if needed, I could also enable a global cache across all tabs that is time-based, which might help further reduce the number of API calls.

This would help so much =)

@MichaelMMasi
Copy link

I have also noticed the rating bar not loading for some videos when opening large playlists and scrolling rapidly, through hundreds of videos. In my usage this occurs often (multiple times daily).

@elliotwaite
Copy link
Owner

@Saxayone and @MichaelMMasi, thanks for the feedback. I'll add a configurable global cache soon which should help.

@elliotwaite
Copy link
Owner

The global cache has been added (version 1.7.0). The default cache duration is 10 minutes, but this can be configured in the settings. The current longest duration option is 24 hr, but if anyone would want a longer option, let me know.

Also, to further help with rate limiting, I've opened a feature request for the Return YouTube Dislike API to support batch requests. If you'd like to support this feature request, giving it a thumbs up here might help: Anarios/return-youtube-dislike#319

@xzuyn
Copy link

xzuyn commented Dec 5, 2022

The current longest duration option is 24 hr

How large does the cache get within 24 hours? I'd assume even with loading a large amount of videos maxing out the API rate for the entire 24 hours, it wouldn't be that large. Maybe a couple MBs max?

Is there a downside to a large cache compared to a small one? Like page loading speed with slow hard drives? or page performance on slower systems?

How does the cache expire? Does the entire cache expire at the 24 hour mark (including from videos cached less than 24 hours old), or is each video marked with a timestamp and only after a video's cache timestamp reaches 24 hours it gets cleared?

Also thanks for the extension :)

@elliotwaite
Copy link
Owner

@xzuyn The cache should be quite small. For each video it only stores the video ID, the like count, the dislike count, and the time when that data was retrieved. I’m not sure what a typical size would be in MB.

The downside of using a longer cache duration isn’t so much memory size, but rather that you wouldn’t always be seeing the latest ratings. This is mostly only important for recently released videos. The main upside of using a longer cache duration is that it reduces the chance of hitting the rating API’s rate limit. When you hit the rate limit, you will start seeing thumbnails don’t have rating bars added to them. Another benefit of a longer cache duration is that the cached rating bars may load slightly faster, but this difference is usually negligible.

The cache expires on a rolling basis, meaning if you set the cache duration to be 24 hours, any rating data you retrieved within the last 24 hours will still be in the cache. Or thought of another way, when you see a thumbnail which isn’t in the cache, it retrieves the current rating for that video, and then will reuse that rating if you ever see that thumbnail again in the next 24 hours. Closing and reopening the browser also clears the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests