Skip to content

Conversation

@shiny-comic
Copy link
Contributor

This PR fixes #5403.

Copy link
Member

@Fijxu Fijxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works fine!
Youtube doesn't seem to return viewCountText and it only returns shortViewCountText now.

Image

Edit: Since viewCountText is not returned anymore, we should add a comment about it above this variable (or just delete the variable) but I'm not sure what compact renderer is:

# "4,088,033 views", only available on compact renderer
# and when video is not a livestream
view_count = related.dig?("viewCountText", "simpleText")
.try &.as_s.gsub(/\D/, "")

@SamantazFox There is any background about that line that was written 3 years ago?

@syeopite
Copy link
Member

syeopite commented Sep 8, 2025

Its either for an old Innertube structure which never got removed in Invidious or just how the view count is stored in the Innertube responses of some other InnerTube client different than the ones that Invidious currently uses

@SamantazFox
Copy link
Member

@SamantazFox There is any background about that line that was written 3 years ago?

It was introduced in #2856, when Youtube switched to the compactVideoRenderer for related videos (in the next endpoint response).

If that's not relevant anymore, that can be removed.

@Fijxu Fijxu merged commit 5cfe294 into iv-org:master Oct 17, 2025
8 of 9 checks passed
Precific added a commit to Precific/Materialious-pullreq that referenced this pull request Nov 1, 2025
Invidious removed viewCount from the API for related/recommended videos
iv-org/invidious#5446
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

Successfully merging this pull request may close these issues.

[Bug] 0 views on all related videos on any instances

4 participants