Skip to content

[YouTube] Fix retrieving the like count for videos with no likes#1439

Open
G-flat wants to merge 1 commit intoTeamNewPipe:devfrom
G-flat:fix_like_count_for_yt_videos_with_no_likes
Open

[YouTube] Fix retrieving the like count for videos with no likes#1439
G-flat wants to merge 1 commit intoTeamNewPipe:devfrom
G-flat:fix_like_count_for_yt_videos_with_no_likes

Conversation

@G-flat
Copy link
Contributor

@G-flat G-flat commented Jan 25, 2026

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

My pull request follows @AudricV's suggestions in #1436 by rewriting getLikeCount() to only use the logic from parseLikeCountFromLikeButtonViewModel() and returning zero likes if a like count can't be extracted from accessibilityText.

Fixes #1436 and fixes TeamNewPipe/NewPipe#13068.

@AudricV AudricV self-requested a review January 26, 2026 08:13
@ShareASmile ShareASmile added bug Issue is related to a bug youtube service, https://www.youtube.com/ labels Jan 26, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
E Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

thank you

@TobiGr
Copy link
Contributor

TobiGr commented Feb 22, 2026

could you add a test for a video that has 0 likes?

@G-flat
Copy link
Contributor Author

G-flat commented Feb 23, 2026

I can, but I'm not sure if the video I choose will continue to stay at 0 likes over time. Do you think it would be better for me to write a test for a video that currently has 0 likes, or make a test that checks whether at least one of several videos, all currently with 0 likes, has no likes?

@TobiGr
Copy link
Contributor

TobiGr commented Feb 24, 2026

that's a good question. If you know multiple videos with zero likes it might be better to test that at least one of the has zero likes and the other's have a small, but positive like count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue is related to a bug youtube service, https://www.youtube.com/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in displaying the like count for YouTube videos with no likes Error in displaying the like count for YouTube videos with no likes

3 participants