Fix getSubscriberCount() for 0 subscribers

This commit is contained in:
wb9688 2020-02-27 16:26:22 +01:00
parent 8ebd971648
commit 0798bdd5cd

View file

@ -177,8 +177,12 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
throw new ParsingException("Could not get subscriber count", e);
}
} else {
// If the element is null, the channel have the subscriber count disabled
return -1;
// If there's no subscribe button, the channel has the subscriber count disabled
if (initialData.getObject("header").getObject("c4TabbedHeaderRenderer").getObject("subscribeButton") == null) {
return -1;
} else {
return 0;
}
}
}