From a6961c5efa29c5a6cbeffb73866837cb8c3974e1 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 27 Dec 2021 16:50:08 +0100 Subject: [PATCH] Fixed NumberFormatException when processing likes See also #7525 --- .../services/youtube/extractors/YoutubeStreamExtractor.java | 4 ++++ 1 file changed, 4 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 6a8b73cf..34b56d64 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 @@ -358,6 +358,10 @@ public class YoutubeStreamExtractor extends StreamExtractor { return -1; } + if (likesString.toLowerCase().contains("no likes")) { + return 0; + } + return Integer.parseInt(Utils.removeNonDigitCharacters(likesString)); } catch (final NumberFormatException nfe) { throw new ParsingException("Could not parse \"" + likesString + "\" as an Integer",