Merge pull request #126 from Adam77Root/master
Fix view count parsing for large numbers
This commit is contained in:
commit
86a0177855
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue