1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-11 21:09:10 +01:00

Merge pull request #126 from Adam77Root/master

Fix view count parsing for large numbers
This commit is contained in:
Christian Schabesberger 2015-12-25 16:02:10 +01:00
commit 86a0177855
2 changed files with 3 additions and 3 deletions

View File

@ -109,7 +109,7 @@ public abstract class VideoExtractor {
protected abstract String getDescription();
protected abstract String getUploader();
protected abstract int getLength();
protected abstract int getViews();
protected abstract long getViews();
protected abstract String getUploadDate();
protected abstract String getThumbnailUrl();
protected abstract String getUploaderThumbnailUrl();

View File

@ -155,10 +155,10 @@ public class YoutubeVideoExtractor extends VideoExtractor {
}
@Override
public int getViews() {
public long getViews() {
try {
String viewCountString = doc.select("meta[itemprop=interactionCount]").attr("content");
return Integer.parseInt(viewCountString);
return Long.parseLong(viewCountString);
} catch (Exception e) {//todo: find fallback method
Log.e(TAG, "failed to number of views");
e.printStackTrace();