Fix view count parsing for large numbers

This commit is contained in:
Adam77Root 2015-12-25 15:03:11 +01:00
parent 365137c32b
commit 718d4fd0bd
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 getDescription();
protected abstract String getUploader(); protected abstract String getUploader();
protected abstract int getLength(); protected abstract int getLength();
protected abstract int getViews(); protected abstract long getViews();
protected abstract String getUploadDate(); protected abstract String getUploadDate();
protected abstract String getThumbnailUrl(); protected abstract String getThumbnailUrl();
protected abstract String getUploaderThumbnailUrl(); protected abstract String getUploaderThumbnailUrl();

View File

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