Catch NumberFormatException instead of checking whether viewCount equals "Recommended for you"
This commit is contained in:
parent
3e4d2fd64e
commit
2807079531
1 changed files with 3 additions and 1 deletions
|
@ -195,8 +195,10 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
|
|||
return -1;
|
||||
}
|
||||
String viewCount = getTextFromObject(videoInfo.getObject("viewCountText"));
|
||||
if (viewCount.equals("Recommended for you")) return -1;
|
||||
|
||||
return Long.parseLong(Utils.removeNonDigitCharacters(viewCount));
|
||||
} catch (NumberFormatException e) {
|
||||
return -1;
|
||||
} catch (Exception e) {
|
||||
throw new ParsingException("Could not get view count", e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue