2
0
mirror of https://github.com/TeamNewPipe/NewPipeExtractor synced 2025-08-30 22:05:18 +00:00

Adress requested changes

This commit is contained in:
TiA4f8R
2021-06-05 18:17:26 +02:00
parent 54d4551ca6
commit 34a9ccb0fd

View File

@@ -401,15 +401,15 @@ public class YoutubeParsingHelper {
try {
key = Parser.matchGroup1("INNERTUBE_API_KEY\":\"([0-9a-zA-Z_-]+?)\"", html);
keyAndVersionExtracted = true;
} catch (final Parser.RegexException e) {
} catch (final Parser.RegexException e1) {
try {
key = Parser.matchGroup1("innertubeApiKey\":\"([0-9a-zA-Z_-]+?)\"", html);
keyAndVersionExtracted = true;
} catch (final Parser.RegexException ignored) {
}
}
} catch (final Parser.RegexException e2) {
keyAndVersionExtracted = false;
throw new ParsingException("Could not extract client version and key");
}
}
keyAndVersionExtracted = true;
}
/**
@@ -422,7 +422,6 @@ public class YoutubeParsingHelper {
}
if (!keyAndVersionExtracted) extractClientVersionAndKey();
if (isNullOrEmpty(key)) throw new ParsingException("Could not extract client version");
return clientVersion;
}
@@ -434,7 +433,6 @@ public class YoutubeParsingHelper {
if (areHardcodedClientVersionAndKeyValid()) return key = HARDCODED_KEY;
if (!keyAndVersionExtracted) extractClientVersionAndKey();
if (isNullOrEmpty(key)) throw new ParsingException("Could not extract key");
return key;
}