Skip to content

Commit 1a67ea1

Browse files
committed
Refactored code
according to review
1 parent f79ce1f commit 1a67ea1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public InfoItemsPage<CommentsInfoItem> getInitialPage()
7373

7474
/**
7575
* Finds the initial comments token and initializes commentsDisabled.
76-
* Also set
76+
* <br/>
77+
* Also sets {@link #optCommentsDisabled}.
7778
*
7879
* @return the continuation token or null if none was found
7980
*/
@@ -85,14 +86,12 @@ private String findInitialCommentsToken() throws ExtractionException {
8586
// Only use JsonObjects
8687
.filter(JsonObject.class::isInstance)
8788
.map(JsonObject.class::cast)
88-
// Only process JsonObjects that have a itemSectionRenderer
89-
.filter(jObj -> jObj.has("itemSectionRenderer"))
9089
// Check if the comment-section is present
9190
.filter(jObj -> {
9291
try {
9392
return "comments-section".equals(
9493
JsonUtils.getString(jObj, "itemSectionRenderer.targetId"));
95-
} catch (final ParsingException ex) {
94+
} catch (final ParsingException ignored) {
9695
return false;
9796
}
9897
})
@@ -105,7 +104,7 @@ private String findInitialCommentsToken() throws ExtractionException {
105104
.getObject("itemSectionRenderer")
106105
.getArray("contents").getObject(0),
107106
"continuationItemRenderer.continuationEndpoint.continuationCommand.token");
108-
} catch (final ParsingException ex) {
107+
} catch (final ParsingException ignored) {
109108
return null;
110109
}
111110
})

0 commit comments

Comments
 (0)