You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[YouTube] Fix extraction of like count with the new data model
In the new data model currently A/B tested or deployed, the like count button
data is the same, but its path has been changed.
The extraction of the like count has been also improved, by using the multiple
accessibility data available instead of the only one which was used before.
This accessibility data has been also deprioritized, because it is language
dependent when there is no view.
Like count is always known, even for age-restricted videos, so returning -1 if
the like count extraction fails on this type of videos is not needed and hides
an extraction error: that's the reason why this return has been removed and the
exception will always be thrown, even if a video is age-restricted.
Copy file name to clipboardExpand all lines: extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java
+73-16Lines changed: 73 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -417,28 +417,88 @@ public long getViewCount() throws ParsingException {
417
417
@Override
418
418
publiclonggetLikeCount() throwsParsingException {
419
419
assertPageFetched();
420
+
421
+
// If ratings are not allowed, there is no like count available
422
+
if (!playerResponse.getObject("videoDetails").getBoolean("allowRatings")) {
0 commit comments