Apply requested codestyle improvements.

This commit is contained in:
FireMasterK 2022-02-26 17:12:51 +00:00
parent 6950b362f2
commit e6d334765d
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
2 changed files with 34 additions and 36 deletions

View file

@ -273,16 +273,15 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
public long getSubscriberCount() throws ParsingException {
final JsonObject c4TabbedHeaderRenderer = initialData.getObject("header")
.getObject("c4TabbedHeaderRenderer");
if (c4TabbedHeaderRenderer.has("subscriberCountText")) {
if (!c4TabbedHeaderRenderer.has("subscriberCountText")) {
return UNKNOWN_SUBSCRIBER_COUNT;
}
try {
return Utils.mixedNumberWordToLong(getTextFromObject(c4TabbedHeaderRenderer
.getObject("subscriberCountText")));
} catch (final NumberFormatException e) {
throw new ParsingException("Could not get subscriber count", e);
}
} else {
return UNKNOWN_SUBSCRIBER_COUNT;
}
}
@Override

View file

@ -440,15 +440,14 @@ public class YoutubeStreamExtractor extends StreamExtractor {
@Override
public long getUploaderSubscriberCount() throws ParsingException {
final JsonObject videoOwnerRenderer = JsonUtils.getObject(videoSecondaryInfoRenderer, "owner.videoOwnerRenderer");
if (videoOwnerRenderer.has("subscriberCountText")) {
if (!videoOwnerRenderer.has("subscriberCountText")) {
return UNKNOWN_SUBSCRIBER_COUNT;
}
try {
return Utils.mixedNumberWordToLong(getTextFromObject(videoOwnerRenderer.getObject("subscriberCountText")));
} catch (final NumberFormatException e) {
throw new ParsingException("Could not get uploader subscriber count", e);
}
} else {
return UNKNOWN_SUBSCRIBER_COUNT;
}
}
@Nonnull