Apply requested codestyle improvements.
This commit is contained in:
parent
6950b362f2
commit
e6d334765d
2 changed files with 34 additions and 36 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue