Fix view count parsing for large numbers
This commit is contained in:
parent
365137c32b
commit
718d4fd0bd
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue