Skip to content

Commit 65687f3

Browse files
committed
Removed YT dislike count as it no longer works
1 parent 1e2e002 commit 65687f3

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -370,31 +370,6 @@ public long getLikeCount() throws ParsingException {
370370
}
371371
}
372372

373-
@Override
374-
public long getDislikeCount() throws ParsingException {
375-
assertPageFetched();
376-
377-
// YouTube is "gradually rolling out" removing dislike count
378-
// https://blog.youtube/news-and-events/update-to-youtube/
379-
// Getting dislikes might not work forever
380-
381-
// Calculate dislike with average rating and like count
382-
try {
383-
long likes = getLikeCount();
384-
double averageRating = playerResponse.getObject("videoDetails").getDouble("averageRating");
385-
386-
if (likes != -1 && averageRating > 1 && averageRating <= 5) {
387-
// If averageRating can't be gathered, it will be 0,
388-
// but we also can't divide by 0 so we need > 1
389-
return Math.round(likes * ((5 - averageRating) / (averageRating - 1)));
390-
}
391-
} catch (final Exception ex) {
392-
throw new ParsingException("Could not get dislike count", ex);
393-
}
394-
395-
return -1;
396-
}
397-
398373
@Nonnull
399374
@Override
400375
public String getUploaderUrl() throws ParsingException {

0 commit comments

Comments
 (0)