From ab49cb6e18cfb50d07e450281ab5d1f04e0f2a7c Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Sat, 12 Feb 2022 18:00:54 +0000 Subject: [PATCH] Add requested changes. --- .../services/youtube/extractors/YoutubeChannelExtractor.java | 4 +++- .../services/youtube/extractors/YoutubeStreamExtractor.java | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java index d7ba0712..6b19d606 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java @@ -61,6 +61,8 @@ public class YoutubeChannelExtractor extends ChannelExtractor { private JsonObject initialData; private JsonObject videoTab; + private static final long UNKNOWN_SUBSCRIBER_COUNT = -1; + /** * Some channels have response redirects and the only way to reliably get the id is by saving it. *
@@ -281,7 +283,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
throw new ParsingException("Could not get subscriber count", e);
}
} else {
- return ITEM_COUNT_UNKNOWN;
+ return UNKNOWN_SUBSCRIBER_COUNT;
}
}
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 3e377b55..3799dec7 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
@@ -45,7 +45,6 @@ import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
-import static org.schabi.newpipe.extractor.ListExtractor.ITEM_COUNT_UNKNOWN;
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.*;
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
import static org.schabi.newpipe.extractor.utils.Utils.UTF_8;
@@ -104,6 +103,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
@Nullable
private List