Giter Site home page Giter Site logo

anarios / return-youtube-dislike Goto Github PK

View Code? Open in Web Editor NEW
12.2K 93.0 535.0 5.03 MB

Chrome extension to return youtube dislikes

Home Page: https://returnyoutubedislike.com/

License: GNU General Public License v3.0

JavaScript 35.64% CSS 2.81% HTML 4.33% Vue 17.62% TypeScript 39.59% Shell 0.03%
chrome-extension youtube firefox firefox-addon firefox-extension dislike dislikes dislikes-count dislike-button

return-youtube-dislike's People

Contributors

aaronkerckhoff avatar anarios avatar aryavsaigal avatar blueberryy avatar callmealexo avatar cupiditys avatar cyrildtm avatar davekeehl avatar erykdarnowski avatar fernandodilland avatar frontesque avatar hayao0819 avatar hyperstown avatar ilbailba avatar kalinkagit avatar kashboi7 avatar kendalldoescoding avatar leonbubova avatar medustyy avatar moondarker avatar mphelp avatar nightcaat avatar picklenik avatar rospino74 avatar sky-niniko avatar sqrtryan avatar sy-b avatar thereaper90917 avatar thesusian avatar underscorex5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

return-youtube-dislike's Issues

(Question): Updates of the dislike count of new videos in the backend

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:

  • If the video is not cached: Request dislike count and cache
  • If the video is cached and is older than for example one month: Use the cached data
  • If the video is cached and is newer than one month: Use the cached data for some hours, otherwise request the count again and update the cache

(Bug): Marked ARR on AMO

Browser

Firefox

Browser Version

94.0.2

Extension or Userscript?

Extension

Extension/Userscript Version

latest

Video link where you see the problem

no

What happened?

Should be marked with license correctly on addons.mozilla.

(Feature Request): Source code for the backend

Extension or Userscript?

Both

Request or suggest a new feature!

I want to suggest open-sourcing the backend so that people can self-host it and also maybe contribute to it.

Ways to implement this!

Release the source code on GitHub

Can you work on this?

  • Yes
  • No

Firefox for Android

Would it be possible/within scope to add this extension to Firefox for android? It seems to be currently unavaliable.

(kinda) Doesn't work on Edge

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
have
That component is not displayed on screen, the displayed one is
want

Changed id method getButtons() looks for from menu-container to actions-inner and everything works for me.

(Feature Request): Archive dislikes for the inevitable API killswitch

Extension or Userscript?

Both

Request or suggest a new feature!

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.

Ways to implement this!

No response

Can you work on this?

  • Yes
  • No

(Feature Request): Like/dislike next to each thumbnail on YouTube.

Extension or Userscript?

Both

Request or suggest a new feature!

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

Ways to implement this!

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.

Can you work on this?

  • No
  • Yes

(Feature Request): Query a hash prefix to improve privacy

Extension or Userscript?

Both

Request or suggest a new feature!

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.

Ways to implement this!

  1. Add an endpoint in the API to receive a hash prefix and return data from all videos that match this prefix;
  2. Make the clients use this endpoint.

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.

Can you work on this?

  • Yes (in the client code)
  • No (in the server code)

Support for Firefox Andoid(FR)

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 (^^)

I can't get the script or extension to work

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).

(Bug): When dislikes updates on a live video it appends the new count to the previous count

Browser

Google Chrome

Browser Version

Version 96.0.4664.45

Extension or Userscript?

Extension

Extension/Userscript Version

v0.0.0.9

Video link where you see the problem

https://www.youtube.com/watch?v=AdUw5RdyZxI

What happened?

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.

(Feature Request): Option to not run on unlisted or private videos

Extension or Userscript?

Both

Request or suggest a new feature!

There needs to be a way to prevent this script from running on unlisted or private videos.

Ways to implement this!

This is a large privacy issue that can be fixed by checking the page for a private or unlisted badge before using the API.
badge

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;
}

Can you work on this?

  • Yes
  • No
  • Unsure

(Feature Request): Option for content creators to submit their private dislike counter to the database

Extension or Userscript?

Both

Request or suggest a new feature!

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.

Ways to implement this!

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.

Can you work on this?

  • Yes
  • No

Confusing readme

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?

(Feature Request):Add user's input to the counter

Extension or Userscript?

Both

Request or suggest a new feature!

It would be great if the user input was incorporated in the counter...

EX; Press dislike, dislike counter goes up by one.

Ways to implement this!

No response

Can you work on this?

  • Yes
  • No

The counter is incorrect

is marking 0, 1 or 2 depending on the video (not only on linus videos)
yes, linus has few dislikes, but only 1?

Captura de tela 2021-11-21 223308

(Bug): Youtube Redux Like/Dislike Bar

Browser

Firefox

Browser Version

Firefox 84.0b8

Extension or Userscript?

Extension

Extension/Userscript Version

0.0.0.8

Video link where you see the problem

https://www.youtube.com/watch?v=ussCHoQttyQ

What happened?

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
Screenshot (735)

(Bug): Opera sometimes displays "like/dislike" ratio wrong

Browser

Opera

Browser Version

81.0.4196.54

Extension or Userscript?

Userscript

Extension/Userscript Version

0.0.0.7

Video link where you see the problem

https://www.youtube.com/watch?v=s4-gMgdsnHQ

What happened?

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.

Spoofing votes

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

Add license

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.

(Feature Request): Storing dislike information on own server

Extension or Userscript?

Both

Request or suggest a new feature!

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.

Ways to implement this!

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)

Can you work on this?

  • Yes
  • No

url based comment plugin

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?

(Bug): extension not working after clear data browser

Browser

Google Chrome

Browser Version

Chromium v95

Extension or Userscript?

Extension

Extension/Userscript Version

0.0.0.7

Video link where you see the problem

extension not working after clear data browser

What happened?

A bug happened! extension not working after clear data browser

(Feature Request): GitHub: Tag release versions and upload CRX/XPI/user.js per version

Extension or Userscript?

Both

Request or suggest a new feature!

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.

Ways to implement this!

Tag releases as they are on the website using Git, and upload compiled/packaged code under the release tags section on GitHub.

Can you work on this?

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.

  • Yes
  • Maybe
  • No

having trouble on Qutebrowser. Maybe write a greasemonkey script?

Extension or Userscript?

Userscript

Request or suggest a new feature!

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

Ways to implement this!

No response

Can you work on this?

  • Yes
  • No

(Feature Request): Support for Invidious and/or Piped

Extension or Userscript?

Userscript

Request or suggest a new feature!

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.

Ways to implement this!

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.

Can you work on this?

  • Yes
  • No

Feature Request

Extension or Userscript?

Extension

Request or suggest a new feature!

Can you add Microsoft Edge Extension?

Ways to implement this!

idk

Can you work on this?

  • Yes
  • No

Ratio bar disabled

It is possible to disable this bar or add options on/off this in extension settings.
Screen Shot 20-11-21 001

Not working on Brave

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.

Use Babel for UserScripts

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?

Doesn't work on Safari with UserScripts

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

(Bug): Unable to verify video load or find button

Browser

Brave

Browser Version

Version 1.32.106 Chromium: 96.0.4664.45 (Official Build) (x86_64)

Extension or Userscript?

Userscript

Extension/Userscript Version

0.5

What happened?

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.

(Feature Request): Gather data from YouTube Studio

Extension or Userscript?

Both

Request or suggest a new feature!

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.

Ways to implement this!

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:
image
<div class="percentage style-scope yta-table-card" style="width:100%;background:rgba(235, 93, 166, 1);"> </div>

Can you work on this?

  • Yes
  • No

(Bug): numberFormat rounds the dislike number

Browser

Brave (But should happen on all browsers)

Browser Version

Version 1.31.91 Chromium: 95.0.4638.69

Extension or Userscript?

Extension

Extension/Userscript Version

v0.0.0.9

Video link where you see the problem

https://www.youtube.com/watch?v=YbJOTdZBX1g

What happened?

function numberFormat(numberState) {
    const userLocales = navigator.language;
    const formatter = Intl.NumberFormat(userLocales, { notation: "compact" });
    return formatter.format(numberState);
  }

This function rounds the numberState
image
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.
image

Soultion

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

A bold idea: the app should have its own voting system

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.

Not working on Chrome

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.

API Caching

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?

(Feature Request): No replacing if the dislike count is present by itself

Extension or Userscript?

Both

Request or suggest a new feature!

Avoid replacing the dislike counter if the user still can see the dislike count by itself.

Ways to implement this!

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.

Can you work on this?

  • Yes
  • No

Wild Suggestion (Suggestion)

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.