mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-14 22:30:33 +05:30
Merge pull request #444 from Stypox/error-message
Remove any reference to decrypt and improve error message
This commit is contained in:
commit
bcc01b99c7
@ -637,7 +637,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
private static final String FORMATS = "formats";
|
private static final String FORMATS = "formats";
|
||||||
private static final String ADAPTIVE_FORMATS = "adaptiveFormats";
|
private static final String ADAPTIVE_FORMATS = "adaptiveFormats";
|
||||||
private static final String HTTPS = "https:";
|
private static final String HTTPS = "https:";
|
||||||
private static final String DEOBFUSCATION_FUNC_NAME = "decrypt";
|
private static final String DEOBFUSCATION_FUNC_NAME = "deobfuscate";
|
||||||
|
|
||||||
private final static String[] REGEXES = {
|
private final static String[] REGEXES = {
|
||||||
"(?:\\b|[^a-zA-Z0-9$])([a-zA-Z0-9$]{2})\\s*=\\s*function\\(\\s*a\\s*\\)\\s*\\{\\s*a\\s*=\\s*a\\.split\\(\\s*\"\"\\s*\\)",
|
"(?:\\b|[^a-zA-Z0-9$])([a-zA-Z0-9$]{2})\\s*=\\s*function\\(\\s*a\\s*\\)\\s*\\{\\s*a\\s*=\\s*a\\.split\\(\\s*\"\"\\s*\\)",
|
||||||
@ -794,7 +794,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ParsingException(
|
throw new ParsingException(
|
||||||
"Could load deobfuscation code form restricted video for the Youtube service.", e);
|
"Could not load deobfuscation code from YouTube video embed", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -839,8 +839,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
final Object result;
|
final Object result;
|
||||||
try {
|
try {
|
||||||
final ScriptableObject scope = context.initSafeStandardObjects();
|
final ScriptableObject scope = context.initSafeStandardObjects();
|
||||||
context.evaluateString(scope, deobfuscationCode, "decryptionCode", 1, null);
|
context.evaluateString(scope, deobfuscationCode, "deobfuscationCode", 1, null);
|
||||||
final Function deobfuscateFunc = (Function) scope.get("decrypt", scope);
|
final Function deobfuscateFunc = (Function) scope.get(DEOBFUSCATION_FUNC_NAME, scope);
|
||||||
result = deobfuscateFunc.call(context, scope, scope, new Object[]{obfuscatedSig});
|
result = deobfuscateFunc.call(context, scope, scope, new Object[]{obfuscatedSig});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new DeobfuscateException("Could not get deobfuscate signature", e);
|
throw new DeobfuscateException("Could not get deobfuscate signature", e);
|
||||||
|
Loading…
Reference in New Issue
Block a user