Improve based on review/feedback.

This commit is contained in:
FireMasterK 2021-09-02 00:35:56 +05:30
parent b9fad4fcc8
commit 0ba03c552c
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
3 changed files with 4 additions and 3 deletions

View File

@ -168,7 +168,8 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
public String getUploaderAvatarUrl() throws ParsingException {
if(videoInfo.has("channelThumbnailSupportedRenderers")) {
return JsonUtils.getArray(videoInfo, "channelThumbnailSupportedRenderers.channelThumbnailWithLinkRenderer.thumbnail.thumbnails").getObject(0).getString("url");
return JsonUtils.getArray(videoInfo, "channelThumbnailSupportedRenderers.channelThumbnailWithLinkRenderer.thumbnail.thumbnails")
.getObject(0).getString("url");
}
return null;

View File

@ -88,7 +88,7 @@ public class StreamInfoItem extends InfoItem {
return uploaderAvatarUrl;
}
public void setUploaderAvatarUrl(String uploaderAvatarUrl) {
public void setUploaderAvatarUrl(final String uploaderAvatarUrl) {
this.uploaderAvatarUrl = uploaderAvatarUrl;
}

View File

@ -338,7 +338,7 @@ public class YoutubeSearchExtractorTest {
@Test
public void testUploaderAvatar() throws IOException, ExtractionException {
final List<InfoItem> items = extractor.getInitialPage().getItems();
for (InfoItem item : items) {
for (final InfoItem item : items) {
assertNotNull(((StreamInfoItem) item).getUploaderAvatarUrl());
}
}