Skip to content

Commit 583e9c1

Browse files
committed
Fix getPage()
Someone should check if there are unstaged changes before committing...
1 parent 5842b9a commit 583e9c1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public InfoItemsPage<StreamInfoItem> getPage(String pageUrl) throws IOException,
219219
headers.put("X-YouTube-Client-Version",
220220
Collections.singletonList(YoutubeParsingHelper.HARDCODED_CLIENT_VERSION));
221221
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
222-
if (response.length() > 50) { // ensure to have a valid response
222+
if (response.length() < 50) { // ensure to have a valid response
223223
throw new ParsingException("Could not parse json data for next streams");
224224
}
225225
ajaxJson = JsonParser.array().from(response);
@@ -228,7 +228,7 @@ public InfoItemsPage<StreamInfoItem> getPage(String pageUrl) throws IOException,
228228
headers.put("X-YouTube-Client-Version",
229229
Collections.singletonList(YoutubeParsingHelper.getClientVersion(initialData, doc.toString())));
230230
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
231-
if (response.length() > 50) { // ensure to have a valid response
231+
if (response.length() < 50) { // ensure to have a valid response
232232
throw new ParsingException("Could not parse json data for next streams");
233233
}
234234
ajaxJson = JsonParser.array().from(response);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public InfoItemsPage<StreamInfoItem> getPage(final String pageUrl) throws IOExce
206206
headers.put("X-YouTube-Client-Version",
207207
Collections.singletonList(YoutubeParsingHelper.HARDCODED_CLIENT_VERSION));
208208
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
209-
if (response.length() > 50) { // ensure to have a valid response
209+
if (response.length() < 50) { // ensure to have a valid response
210210
throw new ParsingException("Could not parse json data for next streams");
211211
}
212212
ajaxJson = JsonParser.array().from(response);
@@ -215,7 +215,7 @@ public InfoItemsPage<StreamInfoItem> getPage(final String pageUrl) throws IOExce
215215
headers.put("X-YouTube-Client-Version",
216216
Collections.singletonList(YoutubeParsingHelper.getClientVersion(initialData, doc.toString())));
217217
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
218-
if (response.length() > 50) { // ensure to have a valid response
218+
if (response.length() < 50) { // ensure to have a valid response
219219
throw new ParsingException("Could not parse json data for next streams");
220220
}
221221
ajaxJson = JsonParser.array().from(response);

0 commit comments

Comments
 (0)