From 30ed4f2d636dbb6112ae1951e646f8756ae93ff4 Mon Sep 17 00:00:00 2001 From: Stypox Date: Mon, 26 Oct 2020 21:22:21 +0100 Subject: [PATCH] Remove any reference to decrypt and improve error message --- .../youtube/extractors/YoutubeStreamExtractor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java index 0b7e8f866..708613f0c 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java @@ -637,7 +637,7 @@ public class YoutubeStreamExtractor extends StreamExtractor { 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*\\)", @@ -794,7 +794,7 @@ public class YoutubeStreamExtractor extends StreamExtractor { } 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); } } @@ -839,8 +839,8 @@ public class YoutubeStreamExtractor extends StreamExtractor { 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);