[YouTube] Handle videos with no views or with "Recommended to you" text
This commit is contained in:
parent
da2c562eb0
commit
2a470ac4f7
1 changed files with 6 additions and 0 deletions
|
@ -203,6 +203,12 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
|
|||
|
||||
final String viewCount = getTextFromObject(viewCountObject);
|
||||
|
||||
if (viewCount.toLowerCase().contains("no views")) {
|
||||
return 0;
|
||||
} else if (viewCount.toLowerCase().contains("recommended")) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return Long.parseLong(Utils.removeNonDigitCharacters(viewCount));
|
||||
} catch (Exception e) {
|
||||
throw new ParsingException("Could not get view count", e);
|
||||
|
|
Loading…
Reference in a new issue