mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-01-11 18:00:32 +00:00
fixed json error from the last commit
This commit is contained in:
parent
a1479d04df
commit
851028997a
@ -191,13 +191,15 @@ public class YoutubeStreamExtractor implements StreamExtractor {
|
|||||||
JSONObject ytPlayerConfig;
|
JSONObject ytPlayerConfig;
|
||||||
|
|
||||||
//attempt to load the youtube js player JSON arguments
|
//attempt to load the youtube js player JSON arguments
|
||||||
String ps; //used to determine if this is a livestream or not
|
String ps = ""; //used to determine if this is a livestream or not
|
||||||
try {
|
try {
|
||||||
ytPlayerConfigRaw =
|
ytPlayerConfigRaw =
|
||||||
Parser.matchGroup1("ytplayer.config\\s*=\\s*(\\{.*?\\});", pageContent);
|
Parser.matchGroup1("ytplayer.config\\s*=\\s*(\\{.*?\\});", pageContent);
|
||||||
ytPlayerConfig = new JSONObject(ytPlayerConfigRaw);
|
ytPlayerConfig = new JSONObject(ytPlayerConfigRaw);
|
||||||
playerArgs = ytPlayerConfig.getJSONObject("args");
|
playerArgs = ytPlayerConfig.getJSONObject("args");
|
||||||
|
if(playerArgs.has("ps")) {
|
||||||
ps = playerArgs.get("ps").toString();
|
ps = playerArgs.get("ps").toString();
|
||||||
|
}
|
||||||
} catch (Parser.RegexException e) {
|
} catch (Parser.RegexException e) {
|
||||||
String errorReason = findErrorReason(doc);
|
String errorReason = findErrorReason(doc);
|
||||||
switch(errorReason) {
|
switch(errorReason) {
|
||||||
|
Loading…
Reference in New Issue
Block a user