From ae48bdea4c7afd78fd072561cee1805fecdc6b77 Mon Sep 17 00:00:00 2001 From: golfinq Date: Fri, 5 Mar 2021 02:40:36 -0500 Subject: [PATCH 1/3] Updated to reflect variable name change --- .../youtube/extractors/YoutubeCommentsExtractor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java index fa03f7e13..537d8e069 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java @@ -46,7 +46,12 @@ public class YoutubeCommentsExtractor extends CommentsExtractor { @Override public InfoItemsPage getInitialPage() throws IOException, ExtractionException { - final String commentsTokenInside = findValue(responseBody, "commentSectionRenderer", "}"); + String commentsTokenInside; + if (responseBody.contains("commentSectionRenderer")) { + commentsTokenInside = findValue(responseBody, "commentSectionRenderer", "}"); + } else{ + commentsTokenInside = findValue(responseBody, "sectionListRenderer", "}"); + } final String commentsToken = findValue(commentsTokenInside, "continuation\":\"", "\""); return getPage(getNextPage(commentsToken)); } From 8bceb57a6c1389361386cc8f05f8dc5c58c5e3c4 Mon Sep 17 00:00:00 2001 From: golfinq Date: Fri, 5 Mar 2021 02:46:06 -0500 Subject: [PATCH 2/3] formatting fix --- .../services/youtube/extractors/YoutubeCommentsExtractor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java index 537d8e069..c80f8fdde 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java @@ -49,7 +49,7 @@ public class YoutubeCommentsExtractor extends CommentsExtractor { String commentsTokenInside; if (responseBody.contains("commentSectionRenderer")) { commentsTokenInside = findValue(responseBody, "commentSectionRenderer", "}"); - } else{ + } else { commentsTokenInside = findValue(responseBody, "sectionListRenderer", "}"); } final String commentsToken = findValue(commentsTokenInside, "continuation\":\"", "\""); From 05213175cd7c8fc0fcf3bd21bf6540acfebac3e5 Mon Sep 17 00:00:00 2001 From: golfinq Date: Fri, 5 Mar 2021 02:49:15 -0500 Subject: [PATCH 3/3] minor edit, made variable final --- .../services/youtube/extractors/YoutubeCommentsExtractor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java index c80f8fdde..ee76f3598 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java @@ -46,7 +46,7 @@ public class YoutubeCommentsExtractor extends CommentsExtractor { @Override public InfoItemsPage getInitialPage() throws IOException, ExtractionException { - String commentsTokenInside; + final String commentsTokenInside; if (responseBody.contains("commentSectionRenderer")) { commentsTokenInside = findValue(responseBody, "commentSectionRenderer", "}"); } else {