Fix getPage()

Someone should check if there are unstaged changes before committing...
This commit is contained in:
TobiGr 2020-02-24 19:09:27 +01:00
parent 5842b9ad37
commit 583e9c1571
2 changed files with 4 additions and 4 deletions

View file

@ -219,7 +219,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
headers.put("X-YouTube-Client-Version",
Collections.singletonList(YoutubeParsingHelper.HARDCODED_CLIENT_VERSION));
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
if (response.length() > 50) { // ensure to have a valid response
if (response.length() < 50) { // ensure to have a valid response
throw new ParsingException("Could not parse json data for next streams");
}
ajaxJson = JsonParser.array().from(response);
@ -228,7 +228,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
headers.put("X-YouTube-Client-Version",
Collections.singletonList(YoutubeParsingHelper.getClientVersion(initialData, doc.toString())));
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
if (response.length() > 50) { // ensure to have a valid response
if (response.length() < 50) { // ensure to have a valid response
throw new ParsingException("Could not parse json data for next streams");
}
ajaxJson = JsonParser.array().from(response);

View file

@ -206,7 +206,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
headers.put("X-YouTube-Client-Version",
Collections.singletonList(YoutubeParsingHelper.HARDCODED_CLIENT_VERSION));
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
if (response.length() > 50) { // ensure to have a valid response
if (response.length() < 50) { // ensure to have a valid response
throw new ParsingException("Could not parse json data for next streams");
}
ajaxJson = JsonParser.array().from(response);
@ -215,7 +215,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
headers.put("X-YouTube-Client-Version",
Collections.singletonList(YoutubeParsingHelper.getClientVersion(initialData, doc.toString())));
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
if (response.length() > 50) { // ensure to have a valid response
if (response.length() < 50) { // ensure to have a valid response
throw new ParsingException("Could not parse json data for next streams");
}
ajaxJson = JsonParser.array().from(response);