diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java index d987af0d..7f1e0129 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java @@ -63,9 +63,13 @@ public class YoutubeChannelInfoItemExtractor implements ChannelInfoItemExtractor } @Override - public long getSubscriberCount() { - // TODO: get subscriber count, it's in subscriberCountText.simpleText as a string like "103M subscribers" - return -1; + public long getSubscriberCount() throws ParsingException { + try { + String subscribers = channelInfoItem.getObject("subscriberCountText").getString("simpleText").split(" ")[0]; + return Utils.mixedNumberWordToLong(subscribers); + } catch (Exception e) { + throw new ParsingException("Could not get subscriber count", e); + } } @Override