mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-25 04:22:30 +01:00
fix bug with parsing like/dislike count
This commit is contained in:
parent
67ba126602
commit
145a7f8e0d
@ -287,12 +287,12 @@ public class YoutubeExtractor implements Extractor {
|
|||||||
// likes
|
// likes
|
||||||
likesString = doc.select("button.like-button-renderer-like-button").first()
|
likesString = doc.select("button.like-button-renderer-like-button").first()
|
||||||
.select("span.yt-uix-button-content").first().text();
|
.select("span.yt-uix-button-content").first().text();
|
||||||
videoInfo.like_count = Integer.parseInt(likesString.replace(",", ""));
|
videoInfo.like_count = Integer.parseInt(likesString.replaceAll("[^\\d]", ""));
|
||||||
// dislikes
|
// dislikes
|
||||||
dislikesString = doc.select("button.like-button-renderer-dislike-button").first()
|
dislikesString = doc.select("button.like-button-renderer-dislike-button").first()
|
||||||
.select("span.yt-uix-button-content").first().text();
|
.select("span.yt-uix-button-content").first().text();
|
||||||
|
|
||||||
videoInfo.dislike_count = Integer.parseInt(dislikesString.replace(",", ""));
|
videoInfo.dislike_count = Integer.parseInt(dislikesString.replaceAll("[^\\d]", ""));
|
||||||
} catch(NumberFormatException nfe) {
|
} catch(NumberFormatException nfe) {
|
||||||
Log.e(TAG, "failed to parse likesString \""+likesString+"\" and dislikesString \""+
|
Log.e(TAG, "failed to parse likesString \""+likesString+"\" and dislikesString \""+
|
||||||
dislikesString+"\" as integers");
|
dislikesString+"\" as integers");
|
||||||
|
Loading…
Reference in New Issue
Block a user