Fix getSubscriberCount() for 0 subscribers
This commit is contained in:
parent
8ebd971648
commit
0798bdd5cd
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue