iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
15.57k stars 1.71k forks source link

[Bug] /API/V1/VIDEOS/:ID doesn't awlays return view and dislike count #3425

Closed Explicit12 closed 6 months ago

Explicit12 commented 1 year ago

I try to use some of open api instances in my personal project, and when I try to fetch some data with code below, sometimes I'm getting dislikeCount and viewCount fields with zeroes.

export async function getVideo(videoId) {
  const response = await invidious.get("/videos/" + videoId, {
    params: {
      fields:
        "title,author,authorId,videoId,viewCount,published,videoThumbnails,likeCount,dislikeCount",
    },
  });
  const data = await response.data;
  return data;
}

The response data:

{
    "title": "A fresh start 🙂",
    "videoId": "-YcbGC1z8TA",
    "videoThumbnails": [
        { ... },
        { ... },
        { ... } .
        ...
    ],
    "published": 1668988800,
    "viewCount": 0,
    "likeCount": 10060,
    "dislikeCount": 0,
    "author": "Louis Rossmann",
    "authorId": "UCl2mFZoRqjw_ELax4Yisf6w"
}

I've tried a couple of different instances, but looks like this bug is featured in everyone.

iBicha commented 1 year ago

This because Youtube does not even provide that info anymore. This is why projects like https://returnyoutubedislike.com/ exists

SamantazFox commented 1 year ago

Views should be there. Only dislikes are unavailable.

SamantazFox commented 1 year ago

What instance are you using? I've tried multiple instances and they all show viex count. Is the instance out of date?

Explicit12 commented 1 year ago

Okay, if dislikes unavailable, It would be nice to have a note in documentation.

I've tried the following instances and met the issue: https://vid.puffyan.us/ (2022.11.17-516efd2), https://invidious.tiekoetter.com/ (2022.11.22-a8e7a805), https://inv.bp.projectsegfau.lt/ (2022.11.21-09b9b75).

And I can get views from https://inv.vern.cc/ (2022.11.03-b925fb96), but likes are zeroes.

SamantazFox commented 1 year ago

Yeah, sorry, the documentation is barely maintained :/ We had to stub the value to not break downstream apps that expected a value here.

Do you have specific video IDs, or it happens on all videos?

Explicit12 commented 1 year ago

No, it's not specific, looks like it happens randomly with any video. Sometimes It may have views count, sometimes not.

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely outdated. If you think this issue is still relevant and applicable, you just have to post a comment and it will be unmarked.