Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public String getErrorMessage() {
private static final String FORMATS = "formats";
private static final String ADAPTIVE_FORMATS = "adaptiveFormats";
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 = {
"(?:\\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*\\)",
Expand Down Expand Up @@ -794,7 +794,7 @@ private EmbeddedInfo getEmbeddedInfo() throws ParsingException, ReCaptchaExcepti

} catch (IOException e) {
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);
}
}

Expand Down Expand Up @@ -839,8 +839,8 @@ private String deobfuscateSignature(String obfuscatedSig, String deobfuscationCo
final Object result;
try {
final ScriptableObject scope = context.initSafeStandardObjects();
context.evaluateString(scope, deobfuscationCode, "decryptionCode", 1, null);
final Function deobfuscateFunc = (Function) scope.get("decrypt", scope);
context.evaluateString(scope, deobfuscationCode, "deobfuscationCode", 1, null);
final Function deobfuscateFunc = (Function) scope.get(DEOBFUSCATION_FUNC_NAME, scope);
result = deobfuscateFunc.call(context, scope, scope, new Object[]{obfuscatedSig});
} catch (Exception e) {
throw new DeobfuscateException("Could not get deobfuscate signature", e);
Expand Down