Package dev.lavalink.youtube
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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final booleanprotected final booleanprotected final SignatureCipherManagerprotected final Client[]protected final com.sedmelluq.discord.lavaplayer.tools.io.HttpInterfaceManagerstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionYoutubeAudioSourceManager(boolean allowSearch) YoutubeAudioSourceManager(boolean allowSearch, boolean allowDirectVideoIds, boolean allowDirectPlaylistIds) YoutubeAudioSourceManager(boolean allowSearch, boolean allowDirectVideoIds, boolean allowDirectPlaylistIds, @NotNull Client... clients) Construct an instance of YoutubeAudioSourceManager with the given settings and clients.YoutubeAudioSourceManager(boolean allowSearch, @NotNull Client... clients) Construct an instance of YoutubeAudioSourceManager with the given settings and clients.YoutubeAudioSourceManager(@NotNull Client... clients) Construct an instance of YoutubeAudioSourceManager with default settings and the given clients.YoutubeAudioSourceManager(YoutubeSourceOptions options, @NotNull Client... clients) -
Method Summary
Modifier and TypeMethodDescription@NotNull YoutubeAudioTrackbuildAudioTrack(com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo trackInfo) @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrackdecodeTrack(@NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo trackInfo, @NotNull DataInput input) voidencodeTrack(com.sedmelluq.discord.lavaplayer.track.AudioTrack track, DataOutput output) @NotNull SignatureCipherManager<T extends Client>
TReturns a client by the given type, if registered.@NotNull Client[]@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterfaceManager@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterfaceprotected @Nullable YoutubeAudioSourceManager.RoutergetRouter(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String identifier) booleanisTrackEncodable(com.sedmelluq.discord.lavaplayer.track.AudioTrack track) @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItemloadItem(@NotNull com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager manager, @NotNull com.sedmelluq.discord.lavaplayer.track.AudioReference reference) protected @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItemloadItemOnce(@NotNull com.sedmelluq.discord.lavaplayer.track.AudioReference reference) protected @Nullable YoutubeAudioSourceManager.RouterrouteFromVideoId(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String videoId, @Nullable UrlTools.UrlInfo urlInfo) voidsetPlaylistPageCount(int count) voidshutdown()
-
Field Details
-
SEARCH_PREFIX
- See Also:
-
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
-
cipherManager
-
-
Constructor Details
-
YoutubeAudioSourceManager
public YoutubeAudioSourceManager() -
YoutubeAudioSourceManager
public YoutubeAudioSourceManager(boolean allowSearch) -
YoutubeAudioSourceManager
public YoutubeAudioSourceManager(boolean allowSearch, boolean allowDirectVideoIds, boolean allowDirectPlaylistIds) -
YoutubeAudioSourceManager
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
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
-
-
Method Details
-
getSourceName
- Specified by:
getSourceNamein interfacecom.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:
loadItemin interfacecom.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
-
getClient
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
-
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:
isTrackEncodablein interfacecom.sedmelluq.discord.lavaplayer.source.AudioSourceManager
-
encodeTrack
- Specified by:
encodeTrackin interfacecom.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:
decodeTrackin interfacecom.sedmelluq.discord.lavaplayer.source.AudioSourceManager
-
shutdown
public void shutdown()- Specified by:
shutdownin interfacecom.sedmelluq.discord.lavaplayer.source.AudioSourceManager
-