mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-27 23:40:36 +05:30
Adress requested changes
This commit is contained in:
parent
54d4551ca6
commit
34a9ccb0fd
@ -401,15 +401,15 @@ public class YoutubeParsingHelper {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
key = Parser.matchGroup1("INNERTUBE_API_KEY\":\"([0-9a-zA-Z_-]+?)\"", html);
|
key = Parser.matchGroup1("INNERTUBE_API_KEY\":\"([0-9a-zA-Z_-]+?)\"", html);
|
||||||
keyAndVersionExtracted = true;
|
} catch (final Parser.RegexException e1) {
|
||||||
} catch (final Parser.RegexException e) {
|
|
||||||
try {
|
try {
|
||||||
key = Parser.matchGroup1("innertubeApiKey\":\"([0-9a-zA-Z_-]+?)\"", html);
|
key = Parser.matchGroup1("innertubeApiKey\":\"([0-9a-zA-Z_-]+?)\"", html);
|
||||||
keyAndVersionExtracted = true;
|
} catch (final Parser.RegexException e2) {
|
||||||
} catch (final Parser.RegexException ignored) {
|
keyAndVersionExtracted = false;
|
||||||
|
throw new ParsingException("Could not extract client version and key");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
keyAndVersionExtracted = false;
|
keyAndVersionExtracted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -422,7 +422,6 @@ public class YoutubeParsingHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!keyAndVersionExtracted) extractClientVersionAndKey();
|
if (!keyAndVersionExtracted) extractClientVersionAndKey();
|
||||||
if (isNullOrEmpty(key)) throw new ParsingException("Could not extract client version");
|
|
||||||
return clientVersion;
|
return clientVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,7 +433,6 @@ public class YoutubeParsingHelper {
|
|||||||
if (areHardcodedClientVersionAndKeyValid()) return key = HARDCODED_KEY;
|
if (areHardcodedClientVersionAndKeyValid()) return key = HARDCODED_KEY;
|
||||||
|
|
||||||
if (!keyAndVersionExtracted) extractClientVersionAndKey();
|
if (!keyAndVersionExtracted) extractClientVersionAndKey();
|
||||||
if (isNullOrEmpty(key)) throw new ParsingException("Could not extract key");
|
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user