Add requested changes.

This commit is contained in:
FireMasterK 2022-02-12 18:00:54 +00:00
parent 4bd59f65f4
commit ab49cb6e18
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
2 changed files with 6 additions and 3 deletions

View file

@ -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.
* <p>
@ -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;
}
}

View file

@ -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<SubtitlesStream> subtitles = null;
private static final long UNKNOWN_SUBSCRIBER_COUNT = -1;
public YoutubeStreamExtractor(final StreamingService service, final LinkHandler linkHandler) {
super(service, linkHandler);
}
@ -448,7 +449,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
throw new ParsingException("Could not get uploader subscriber count", e);
}
} else {
return ITEM_COUNT_UNKNOWN;
return UNKNOWN_SUBSCRIBER_COUNT;
}
}