Skip to content

Commit ab49cb6

Browse files
committed
Add requested changes.
1 parent 4bd59f6 commit ab49cb6

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
6161
private JsonObject initialData;
6262
private JsonObject videoTab;
6363

64+
private static final long UNKNOWN_SUBSCRIBER_COUNT = -1;
65+
6466
/**
6567
* Some channels have response redirects and the only way to reliably get the id is by saving it.
6668
* <p>
@@ -281,7 +283,7 @@ public long getSubscriberCount() throws ParsingException {
281283
throw new ParsingException("Could not get subscriber count", e);
282284
}
283285
} else {
284-
return ITEM_COUNT_UNKNOWN;
286+
return UNKNOWN_SUBSCRIBER_COUNT;
285287
}
286288
}
287289

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import java.time.format.DateTimeFormatter;
4646
import java.util.*;
4747

48-
import static org.schabi.newpipe.extractor.ListExtractor.ITEM_COUNT_UNKNOWN;
4948
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.*;
5049
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
5150
import static org.schabi.newpipe.extractor.utils.Utils.UTF_8;
@@ -104,6 +103,8 @@ public static class DeobfuscateException extends ParsingException {
104103
@Nullable
105104
private List<SubtitlesStream> subtitles = null;
106105

106+
private static final long UNKNOWN_SUBSCRIBER_COUNT = -1;
107+
107108
public YoutubeStreamExtractor(final StreamingService service, final LinkHandler linkHandler) {
108109
super(service, linkHandler);
109110
}
@@ -448,7 +449,7 @@ public long getUploaderSubscriberCount() throws ParsingException {
448449
throw new ParsingException("Could not get uploader subscriber count", e);
449450
}
450451
} else {
451-
return ITEM_COUNT_UNKNOWN;
452+
return UNKNOWN_SUBSCRIBER_COUNT;
452453
}
453454
}
454455

0 commit comments

Comments
 (0)