From 904c9d681fb37449231909ac8452cf95835c5136 Mon Sep 17 00:00:00 2001 From: wb9688 Date: Tue, 17 Mar 2020 15:00:07 +0100 Subject: [PATCH] Fix YouTube videos with no views --- .../services/youtube/extractors/YoutubeStreamExtractor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java index 04818de07..e309ed863 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java @@ -279,6 +279,8 @@ public class YoutubeStreamExtractor extends StreamExtractor { if (views == null) throw new ParsingException("Could not get view count"); } + if (views.toLowerCase().contains("no views")) return 0; + return Long.parseLong(Utils.removeNonDigitCharacters(views)); }