diff --git a/common/src/main/java/dev/lavalink/youtube/cipher/SignatureCipherManager.java b/common/src/main/java/dev/lavalink/youtube/cipher/SignatureCipherManager.java index 97edc80..020e417 100644 --- a/common/src/main/java/dev/lavalink/youtube/cipher/SignatureCipherManager.java +++ b/common/src/main/java/dev/lavalink/youtube/cipher/SignatureCipherManager.java @@ -277,7 +277,7 @@ private SignatureCipher extractFromScript(@NotNull String script, @NotNull Strin String nFunction = nFunctionMatcher.group(0); String nfParameterName = DataFormatTools.extractBetween(nFunction, "(", ")"); // remove short-circuit that prevents n challenge transformation - nFunction = nFunction.replaceAll("if\\s*\\(\\s*typeof\\s*\\w+\\s*===?.*?\\)\\s*return " + nfParameterName + "\\s*;?", ""); + nFunction = nFunction.replaceAll("if\\s*\\(\\s*typeof\\s*\\w+\\s*===?.*?\\)\\s*return\\s+" + nfParameterName + "\\s*;?", ""); SignatureCipher cipherKey = new SignatureCipher(nFunction, scriptTimestamp.group(2), script);