Class YoutubeSignatureCipher
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeSignatureCipher
-
public class YoutubeSignatureCipher extends java.lang.ObjectDescribes one signature cipher
-
-
Constructor Summary
Constructors Constructor Description YoutubeSignatureCipher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOperation(YoutubeCipherOperation operation)java.lang.Stringapply(java.lang.String text)booleanisEmpty()voidsetNFunction(java.lang.String nFunction)voidsetRawScript(java.lang.String script)voidsetTimestamp(java.lang.String timestamp)java.lang.Stringtransform(java.lang.String text, javax.script.ScriptEngine scriptEngine)
-
-
-
Method Detail
-
apply
public java.lang.String apply(java.lang.String text)
- Parameters:
text- Text to apply the cipher on- Returns:
- The result of the cipher on the input text
-
transform
public java.lang.String transform(java.lang.String text, javax.script.ScriptEngine scriptEngine) throws javax.script.ScriptException, java.lang.NoSuchMethodException- Parameters:
text- Text to transformscriptEngine- JavaScript engine to execute function- Returns:
- The result of the n parameter transformation
- Throws:
javax.script.ScriptExceptionjava.lang.NoSuchMethodException
-
addOperation
public void addOperation(YoutubeCipherOperation operation)
- Parameters:
operation- The operation to add to this cipher
-
isEmpty
public boolean isEmpty()
- Returns:
- True if the cipher contains no operations.
-
setNFunction
public void setNFunction(java.lang.String nFunction)
- Parameters:
nFunction- Extracted "n" function
-
setTimestamp
public void setTimestamp(java.lang.String timestamp)
- Parameters:
timestamp- The timestamp in cipher
-
setRawScript
public void setRawScript(java.lang.String script)
- Parameters:
script- Raw script
-
-