mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-13 22:00:32 +05:30
Catch NumberFormatException instead of checking whether viewCount equals "Recommended for you"
This commit is contained in:
parent
3e4d2fd64e
commit
2807079531
@ -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 New Issue
Block a user