Class SignatureCipher

java.lang.Object
dev.lavalink.youtube.cipher.SignatureCipher

public class SignatureCipher extends Object
Describes one signature cipher
  • Field Details

    • nFunction

      public final String nFunction
    • scriptTimestamp

      public final String scriptTimestamp
    • rawScript

      public final String rawScript
  • Constructor Details

    • SignatureCipher

      public SignatureCipher(@NotNull @NotNull String nFunction, @NotNull @NotNull String timestamp, @NotNull @NotNull String rawScript)
  • Method Details

    • apply

      public String apply(@NotNull @NotNull String text)
      Parameters:
      text - Text to apply the cipher on
      Returns:
      The result of the cipher on the input text
    • transform

      public String transform(@NotNull @NotNull String text, @NotNull @NotNull ScriptEngine scriptEngine) throws ScriptException, NoSuchMethodException
      Parameters:
      text - Text to transform
      scriptEngine - JavaScript engine to execute function
      Returns:
      The result of the n parameter transformation
      Throws:
      ScriptException
      NoSuchMethodException
    • addOperation

      public void addOperation(@NotNull @NotNull CipherOperation operation)
      Parameters:
      operation - The operation to add to this cipher
    • isEmpty

      public boolean isEmpty()
      Returns:
      True if the cipher contains no operations.