mirror of
https://github.com/TeamNewPipe/NewPipeExtractor
synced 2025-09-01 06:45:53 +00:00
Fix getPage()
Someone should check if there are unstaged changes before committing...
This commit is contained in:
@@ -219,7 +219,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
|
|||||||
headers.put("X-YouTube-Client-Version",
|
headers.put("X-YouTube-Client-Version",
|
||||||
Collections.singletonList(YoutubeParsingHelper.HARDCODED_CLIENT_VERSION));
|
Collections.singletonList(YoutubeParsingHelper.HARDCODED_CLIENT_VERSION));
|
||||||
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
|
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");
|
throw new ParsingException("Could not parse json data for next streams");
|
||||||
}
|
}
|
||||||
ajaxJson = JsonParser.array().from(response);
|
ajaxJson = JsonParser.array().from(response);
|
||||||
@@ -228,7 +228,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
|
|||||||
headers.put("X-YouTube-Client-Version",
|
headers.put("X-YouTube-Client-Version",
|
||||||
Collections.singletonList(YoutubeParsingHelper.getClientVersion(initialData, doc.toString())));
|
Collections.singletonList(YoutubeParsingHelper.getClientVersion(initialData, doc.toString())));
|
||||||
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
|
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");
|
throw new ParsingException("Could not parse json data for next streams");
|
||||||
}
|
}
|
||||||
ajaxJson = JsonParser.array().from(response);
|
ajaxJson = JsonParser.array().from(response);
|
||||||
|
@@ -206,7 +206,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
|
|||||||
headers.put("X-YouTube-Client-Version",
|
headers.put("X-YouTube-Client-Version",
|
||||||
Collections.singletonList(YoutubeParsingHelper.HARDCODED_CLIENT_VERSION));
|
Collections.singletonList(YoutubeParsingHelper.HARDCODED_CLIENT_VERSION));
|
||||||
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
|
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");
|
throw new ParsingException("Could not parse json data for next streams");
|
||||||
}
|
}
|
||||||
ajaxJson = JsonParser.array().from(response);
|
ajaxJson = JsonParser.array().from(response);
|
||||||
@@ -215,7 +215,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
|
|||||||
headers.put("X-YouTube-Client-Version",
|
headers.put("X-YouTube-Client-Version",
|
||||||
Collections.singletonList(YoutubeParsingHelper.getClientVersion(initialData, doc.toString())));
|
Collections.singletonList(YoutubeParsingHelper.getClientVersion(initialData, doc.toString())));
|
||||||
final String response = getDownloader().get(pageUrl, headers, getExtractorLocalization()).responseBody();
|
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");
|
throw new ParsingException("Could not parse json data for next streams");
|
||||||
}
|
}
|
||||||
ajaxJson = JsonParser.array().from(response);
|
ajaxJson = JsonParser.array().from(response);
|
||||||
|
Reference in New Issue
Block a user