Class YoutubeAudioSourceManager

java.lang.Object
dev.lavalink.youtube.YoutubeAudioSourceManager
All Implemented Interfaces:
com.sedmelluq.discord.lavaplayer.source.AudioSourceManager

public class YoutubeAudioSourceManager extends Object implements com.sedmelluq.discord.lavaplayer.source.AudioSourceManager
  • Field Details

    • SEARCH_PREFIX

      public static final String SEARCH_PREFIX
      See Also:
    • MUSIC_SEARCH_PREFIX

      public static final String MUSIC_SEARCH_PREFIX
      See Also:
    • httpInterfaceManager

      protected final com.sedmelluq.discord.lavaplayer.tools.io.HttpInterfaceManager httpInterfaceManager
    • allowSearch

      protected final boolean allowSearch
    • allowDirectVideoIds

      protected final boolean allowDirectVideoIds
    • allowDirectPlaylistIds

      protected final boolean allowDirectPlaylistIds
    • clients

      protected final Client[] clients
    • cipherManager

      protected final SignatureCipherManager cipherManager
  • Constructor Details

    • YoutubeAudioSourceManager

      public YoutubeAudioSourceManager()
    • YoutubeAudioSourceManager

      public YoutubeAudioSourceManager(boolean allowSearch)
    • YoutubeAudioSourceManager

      public YoutubeAudioSourceManager(boolean allowSearch, boolean allowDirectVideoIds, boolean allowDirectPlaylistIds)
    • YoutubeAudioSourceManager

      public YoutubeAudioSourceManager(@NotNull @NotNull Client... clients)
      Construct an instance of YoutubeAudioSourceManager with default settings and the given clients.
      Parameters:
      clients - The clients to use for track loading. They will be queried in the order they are provided.
    • YoutubeAudioSourceManager

      public YoutubeAudioSourceManager(boolean allowSearch, @NotNull @NotNull Client... clients)
      Construct an instance of YoutubeAudioSourceManager with the given settings and clients.
      Parameters:
      allowSearch - Whether to allow searching for tracks. If disabled, the "ytsearch:" and "ytmsearch:" prefixes will return nothing.
      clients - The clients to use for track loading. They will be queried in the order they are provided.
    • YoutubeAudioSourceManager

      public YoutubeAudioSourceManager(boolean allowSearch, boolean allowDirectVideoIds, boolean allowDirectPlaylistIds, @NotNull @NotNull Client... clients)
      Construct an instance of YoutubeAudioSourceManager with the given settings and clients.
      Parameters:
      allowSearch - Whether to allow searching for tracks. If disabled, the "ytsearch:" and "ytmsearch:" prefixes will return nothing.
      allowDirectVideoIds - Whether this source will attempt to load video identifiers if they're provided without a complete URL (i.e. "dQw4w9WgXcQ")
      allowDirectPlaylistIds - Whether this source will attempt to load playlist identifiers if they're provided without a complete URL.
      clients - The clients to use for track loading. They will be queried in the order they are provided.
    • YoutubeAudioSourceManager

      public YoutubeAudioSourceManager(YoutubeSourceOptions options, @NotNull @NotNull Client... clients)
  • Method Details

    • getSourceName

      public String getSourceName()
      Specified by:
      getSourceName in interface com.sedmelluq.discord.lavaplayer.source.AudioSourceManager
    • setPlaylistPageCount

      public void setPlaylistPageCount(int count)
    • loadItem

      @Nullable public @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItem loadItem(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager manager, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.track.AudioReference reference)
      Specified by:
      loadItem in interface com.sedmelluq.discord.lavaplayer.source.AudioSourceManager
    • loadItemOnce

      @Nullable protected @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItem loadItemOnce(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.track.AudioReference reference)
    • getRouter

      @Nullable protected @Nullable YoutubeAudioSourceManager.Router getRouter(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String identifier)
    • routeFromVideoId

      @Nullable protected @Nullable YoutubeAudioSourceManager.Router routeFromVideoId(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String videoId, @Nullable @Nullable UrlTools.UrlInfo urlInfo)
    • buildAudioTrack

      @NotNull public @NotNull YoutubeAudioTrack buildAudioTrack(com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo trackInfo)
    • getCipherManager

      @NotNull public @NotNull SignatureCipherManager getCipherManager()
    • getClient

      @Nullable public <T extends Client> T getClient(@NotNull @NotNull Class<T> cls)
      Returns a client by the given type, if registered.
      Parameters:
      cls - The class of the client to return.
      Returns:
      The client instance, or null if it's not registered.
    • getClients

      @NotNull public @NotNull Client[] getClients()
    • getHttpInterfaceManager

      @NotNull public @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterfaceManager getHttpInterfaceManager()
    • getInterface

      @NotNull public @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface getInterface()
    • isTrackEncodable

      public boolean isTrackEncodable(com.sedmelluq.discord.lavaplayer.track.AudioTrack track)
      Specified by:
      isTrackEncodable in interface com.sedmelluq.discord.lavaplayer.source.AudioSourceManager
    • encodeTrack

      public void encodeTrack(com.sedmelluq.discord.lavaplayer.track.AudioTrack track, DataOutput output)
      Specified by:
      encodeTrack in interface com.sedmelluq.discord.lavaplayer.source.AudioSourceManager
    • decodeTrack

      @NotNull public @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrack decodeTrack(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo trackInfo, @NotNull @NotNull DataInput input)
      Specified by:
      decodeTrack in interface com.sedmelluq.discord.lavaplayer.source.AudioSourceManager
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface com.sedmelluq.discord.lavaplayer.source.AudioSourceManager