Search in sources :

Example 1 with SpotifyApi

use of se.michaelthelin.spotify.SpotifyApi in project aiode by robinfriedli.

the class Playlist method getTracks.

/**
 * Returns the items in this playlist as objects supported by the {@link PlayableFactory} class. Note that getting the
 * Spotify track for a Song requires this method to be invoked with client credentials
 */
public List<Object> getTracks(SpotifyApi spotifyApi) {
    List<PlaylistItem> playlistItems = getItemsSorted();
    SpotifyTrackBulkLoadingService service = new SpotifyTrackBulkLoadingService(spotifyApi);
    Map<Object, Integer> itemsWithIndex = new HashMap<>();
    for (int i = 0; i < playlistItems.size(); i++) {
        PlaylistItem item = playlistItems.get(i);
        if (item instanceof Song) {
            String id = ((Song) item).getId();
            int finalI = i;
            service.add(createItem(id, TRACK), track -> itemsWithIndex.put(track, finalI));
        } else if (item instanceof Episode) {
            String id = ((Episode) item).getId();
            int finalI = i;
            service.add(createItem(id, EPISODE), track -> itemsWithIndex.put(track, finalI));
        } else if (item instanceof Video) {
            Video video = (Video) item;
            YouTubeVideo youtubeVideo = video.asYouTubeVideo();
            itemsWithIndex.put(youtubeVideo, i);
            String spotifyId = video.getRedirectedSpotifyId();
            if (!Strings.isNullOrEmpty(spotifyId)) {
                SpotifyItemKind kindEntity = video.getRedirectedSpotifyKind();
                SpotifyTrackKind kind = kindEntity != null ? kindEntity.asEnum() : TRACK;
                service.add(createItem(spotifyId, kind), youtubeVideo::setRedirectedSpotifyTrack);
            }
        } else if (item instanceof UrlTrack) {
            itemsWithIndex.put(item, i);
        }
    }
    service.perform();
    return itemsWithIndex.keySet().stream().sorted(Comparator.comparing(itemsWithIndex::get)).collect(Collectors.toList());
}
Also used : Size(javax.validation.constraints.Size) PlayableFactory(net.robinfriedli.aiode.audio.PlayableFactory) SpotifyTrack(net.robinfriedli.aiode.audio.spotify.SpotifyTrack) HashMap(java.util.HashMap) User(net.dv8tion.jda.api.entities.User) Strings(com.google.common.base.Strings) Table(javax.persistence.Table) Lists(com.google.common.collect.Lists) Guild(net.dv8tion.jda.api.entities.Guild) Map(java.util.Map) YouTubeVideo(net.robinfriedli.aiode.audio.youtube.YouTubeVideo) Id(javax.persistence.Id) Entity(javax.persistence.Entity) Collection(java.util.Collection) OneToMany(javax.persistence.OneToMany) Set(java.util.Set) Collectors(java.util.stream.Collectors) SpotifyTrackKind(net.robinfriedli.aiode.audio.spotify.SpotifyTrackKind) SpotifyTrackBulkLoadingService(net.robinfriedli.aiode.audio.spotify.SpotifyTrackBulkLoadingService) Serializable(java.io.Serializable) Objects(java.util.Objects) SpotifyApi(se.michaelthelin.spotify.SpotifyApi) Column(javax.persistence.Column) GenerationType(javax.persistence.GenerationType) List(java.util.List) Stream(java.util.stream.Stream) GeneratedValue(javax.persistence.GeneratedValue) SpringPropertiesConfig(net.robinfriedli.aiode.boot.SpringPropertiesConfig) Comparator(java.util.Comparator) Sets(com.google.api.client.util.Sets) HashMap(java.util.HashMap) SpotifyTrackBulkLoadingService(net.robinfriedli.aiode.audio.spotify.SpotifyTrackBulkLoadingService) YouTubeVideo(net.robinfriedli.aiode.audio.youtube.YouTubeVideo) SpotifyTrackKind(net.robinfriedli.aiode.audio.spotify.SpotifyTrackKind) YouTubeVideo(net.robinfriedli.aiode.audio.youtube.YouTubeVideo)

Example 2 with SpotifyApi

use of se.michaelthelin.spotify.SpotifyApi in project aiode by robinfriedli.

the class UploadCommand method doRun.

@Override
public void doRun() throws Exception {
    SpotifyApi spotifyApi = getContext().getSpotifyApi();
    Playlist playlist = SearchEngine.searchLocalList(getContext().getSession(), getCommandInput());
    if (playlist == null) {
        throw new InvalidCommandException(String.format("No local list found for '%s'", getCommandInput()));
    }
    runWithLogin(() -> {
        List<SpotifyTrack> tracks = playlist.asTrackList(spotifyApi);
        String name = playlist.getName();
        if (tracks.isEmpty()) {
            throw new InvalidCommandException("Playlist " + name + " has no Spotify tracks.");
        }
        String userId = spotifyApi.getCurrentUsersProfile().build().execute().getId();
        se.michaelthelin.spotify.model_objects.specification.Playlist spotifyPlaylist = spotifyApi.createPlaylist(userId, name).build().execute();
        uploadedPlaylistName = spotifyPlaylist.getName();
        String playlistId = spotifyPlaylist.getId();
        List<String> trackUris = tracks.stream().map(SpotifyTrack::getUri).collect(Collectors.toList());
        List<List<String>> sequences = Lists.partition(trackUris, 90);
        for (List<String> sequence : sequences) {
            spotifyApi.addItemsToPlaylist(playlistId, sequence.toArray(new String[0])).build().execute();
        }
        return null;
    });
}
Also used : Playlist(net.robinfriedli.aiode.entities.Playlist) InvalidCommandException(net.robinfriedli.aiode.exceptions.InvalidCommandException) SpotifyTrack(net.robinfriedli.aiode.audio.spotify.SpotifyTrack) SpotifyApi(se.michaelthelin.spotify.SpotifyApi) List(java.util.List)

Example 3 with SpotifyApi

use of se.michaelthelin.spotify.SpotifyApi in project aiode by robinfriedli.

the class AudioTrafficSimulationCommand method runAdmin.

@Override
public void runAdmin() throws Exception {
    Aiode aiode = Aiode.get();
    AudioManager audioManager = aiode.getAudioManager();
    AudioPlayerManager playerManager = audioManager.getPlayerManager();
    PlayableFactory playableFactory = audioManager.createPlayableFactory(getSpotifyService(), new BlockingTrackLoadingExecutor());
    CommandContext context = getContext();
    Guild guild = context.getGuild();
    ThreadExecutionQueue threadExecutionQueue = aiode.getExecutionQueueManager().getForGuild(guild);
    SpotifyApi spotifyApi = context.getSpotifyApi();
    AudioTrackLoader audioTrackLoader = new AudioTrackLoader(playerManager);
    int streams = getArgumentValueOrElse("streams", DEFAULT_STREAM_COUNT);
    int durationSecs = getArgumentValueOrElse("duration", DEFAULT_DURATION);
    String playbackUrl = getArgumentValueOrElse("url", DEFAULT_PLAYBACK_URL);
    Integer nativeBuffer = getArgumentValueWithTypeOrElse("nativeBuffer", Integer.class, null);
    List<Playable> playables = playableFactory.createPlayables(playbackUrl, spotifyApi, true);
    if (playables.isEmpty()) {
        throw new InvalidCommandException("No playables found for url " + playbackUrl);
    }
    Playable playable = playables.get(0);
    AudioItem audioItem = audioTrackLoader.loadByIdentifier(playable.getPlaybackUrl());
    AudioTrack track;
    if (audioItem instanceof AudioTrack) {
        track = (AudioTrack) audioItem;
    } else {
        throw new IllegalStateException("Could not get AudioTrack for Playable " + playable);
    }
    LoopTrackListener loopTrackListener = new LoopTrackListener(track);
    List<Thread> playbackThreads = nativeBuffer != null ? null : Lists.newArrayListWithCapacity(streams);
    List<Tuple2<IAudioSendSystem, AudioPlayer>> audioSendSystems = nativeBuffer != null ? Lists.newArrayListWithCapacity(streams) : null;
    NativeAudioSendFactory nativeAudioSendFactory = nativeBuffer != null ? new NativeAudioSendFactory(nativeBuffer) : null;
    LoggingUncaughtExceptionHandler eh = new LoggingUncaughtExceptionHandler();
    for (int i = 0; i < streams; i++) {
        AudioPlayer player = playerManager.createPlayer();
        player.addListener(loopTrackListener);
        player.playTrack(track.makeClone());
        if (nativeAudioSendFactory != null) {
            IAudioSendSystem sendSystem = nativeAudioSendFactory.createSendSystem(new FakePacketProvider(player));
            audioSendSystems.add(new Tuple2<>(sendSystem, player));
        } else {
            Thread playbackThread = new Thread(new PlayerPollingRunnable(player));
            playbackThread.setDaemon(true);
            playbackThread.setUncaughtExceptionHandler(eh);
            playbackThread.setName("simulated-playback-thread-" + i);
            playbackThreads.add(playbackThread);
        }
    }
    QueuedTask playbackThreadsManagementTask = new QueuedTask(threadExecutionQueue, new FakePlayerManagementTask(playbackThreads, audioSendSystems, durationSecs)) {

        @Override
        protected boolean isPrivileged() {
            return true;
        }
    };
    playbackThreadsManagementTask.setName("simulated-playback-management-task");
    threadExecutionQueue.add(playbackThreadsManagementTask, false);
}
Also used : CommandContext(net.robinfriedli.aiode.command.CommandContext) NativeAudioSendFactory(com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory) ThreadExecutionQueue(net.robinfriedli.aiode.concurrent.ThreadExecutionQueue) AudioTrackLoader(net.robinfriedli.aiode.audio.AudioTrackLoader) AudioPlayer(com.sedmelluq.discord.lavaplayer.player.AudioPlayer) Guild(net.dv8tion.jda.api.entities.Guild) AudioItem(com.sedmelluq.discord.lavaplayer.track.AudioItem) AudioManager(net.robinfriedli.aiode.audio.AudioManager) SpotifyApi(se.michaelthelin.spotify.SpotifyApi) LoggingUncaughtExceptionHandler(net.robinfriedli.aiode.exceptions.handler.handlers.LoggingUncaughtExceptionHandler) BlockingTrackLoadingExecutor(net.robinfriedli.aiode.audio.exec.BlockingTrackLoadingExecutor) PlayableFactory(net.robinfriedli.aiode.audio.PlayableFactory) IAudioSendSystem(net.dv8tion.jda.api.audio.factory.IAudioSendSystem) Aiode(net.robinfriedli.aiode.Aiode) QueuedTask(net.robinfriedli.aiode.concurrent.QueuedTask) AudioPlayerManager(com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager) InvalidCommandException(net.robinfriedli.aiode.exceptions.InvalidCommandException) Playable(net.robinfriedli.aiode.audio.Playable) Tuple2(groovy.lang.Tuple2) AudioTrack(com.sedmelluq.discord.lavaplayer.track.AudioTrack)

Example 4 with SpotifyApi

use of se.michaelthelin.spotify.SpotifyApi in project Robertify-Bot by bombies.

the class Robertify method main.

public static void main(String[] args) {
    WebUtils.setUserAgent("Mozilla/Robertify / bombies#4445");
    try {
        lavalink = new JdaLavalink(getIdFromToken(Config.getBotToken()), Config.getShardCount(), shardId -> Robertify.getShardManager().getShardById(shardId));
        for (var node : Config.getLavaNodes()) lavalink.addNode(node.getURI(), node.getPassword());
        lavalink.getLoadBalancer().addPenalty(LavalinkLoadBalancer.Penalties::getPlayerPenalty);
        lavalink.getLoadBalancer().addPenalty(LavalinkLoadBalancer.Penalties::getCpuPenalty);
        var thread = new ThreadFactoryBuilder().setNameFormat("RobertifyShutdownHook").build();
        Runtime.getRuntime().addShutdownHook(thread.newThread(() -> {
            logger.info("Destroying all players (If any left)");
            shardManager.getGuildCache().stream().filter(guild -> guild.getSelfMember().getVoiceState().inVoiceChannel()).forEach(guild -> {
                GuildMusicManager musicManager = RobertifyAudioManager.getInstance().getMusicManager(guild);
                ResumeUtils.getInstance().saveInfo(guild, guild.getSelfMember().getVoiceState().getChannel());
                musicManager.getScheduler().scheduleDisconnect(false, 0, TimeUnit.SECONDS);
            });
            shardManager.shutdown();
        }));
        DefaultShardManagerBuilder jdaBuilder = DefaultShardManagerBuilder.createDefault(Config.getBotToken(), GatewayIntent.GUILD_VOICE_STATES, GatewayIntent.GUILD_MESSAGES, GatewayIntent.DIRECT_MESSAGES).setShardsTotal(Config.getShardCount()).setBulkDeleteSplittingEnabled(false).setChunkingFilter(ChunkingFilter.NONE).setMemberCachePolicy(MemberCachePolicy.VOICE).addEventListeners(lavalink, VoiceChannelEvents.waiter, commandWaiter, new Listener(), new VoiceChannelEvents(), new DedicatedChannelEvents(), new PollEvents(), new SuggestionCategoryDeletionEvents(), new ReportsEvents(), new AnnouncementChannelEvents(), new LogChannelEvents(), new SkipCommand()).setVoiceDispatchInterceptor(lavalink.getVoiceInterceptor()).addEventListeners(new MenuPaginationTestCommand()).addEventListeners(new PaginationEvents()).enableCache(CacheFlag.VOICE_STATE).disableCache(CacheFlag.ACTIVITY, CacheFlag.EMOTE, CacheFlag.CLIENT_STATUS, CacheFlag.ROLE_TAGS, CacheFlag.ONLINE_STATUS).disableIntents(GatewayIntent.DIRECT_MESSAGE_TYPING, GatewayIntent.GUILD_BANS, GatewayIntent.GUILD_INVITES, GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_MESSAGE_TYPING, GatewayIntent.GUILD_PRESENCES, GatewayIntent.DIRECT_MESSAGE_REACTIONS).setGatewayEncoding(GatewayEncoding.ETF).setActivity(Activity.listening("Starting up..."));
        // Register all slash commands
        SlashCommandManager slashCommandManager = new SlashCommandManager();
        for (var cmd : slashCommandManager.getCommands()) jdaBuilder.addEventListeners(cmd);
        for (var cmd : slashCommandManager.getDevCommands()) jdaBuilder.addEventListeners(cmd);
        // Initialize the JSON directory
        // This is a deprecated feature and is marked for removal
        // Until everything is fully removed, this method needs to be enabled
        // For a proper first-boot.
        AbstractJSONFile.initDirectory();
        AbstractMongoDatabase.initAllCaches();
        logger.info("Initialized all caches");
        new ChangeLogConfig().initConfig();
        GuildDBCache.getInstance().loadAllGuilds();
        logger.info("All guilds have been loaded into cache");
        shardManager = jdaBuilder.build();
        spotifyApi = new SpotifyApi.Builder().setClientId(Config.get(ENV.SPOTIFY_CLIENT_ID)).setClientSecret(Config.get(ENV.SPOTIFY_CLIENT_SECRET)).setRedirectUri(SpotifyHttpManager.makeUri("http://localhost/callback/")).build();
        deezerApi = new DeezerApi();
        initVoteSiteAPIs();
        final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
        scheduler.scheduleAtFixedRate(SpotifyAuthorizationUtils.doTokenRefresh(), 0, 1, TimeUnit.HOURS);
        try {
            baringo = new BaringoClient.Builder().clientAuth(Config.get(ENV.IMGUR_CLIENT), Config.get(ENV.IMGUR_SECRET)).build();
        } catch (BaringoApiException e) {
            logger.error("[ERROR] There was an issue building the Baringo client!", e);
        }
    } catch (Exception e) {
        logger.error("[FATAL ERROR] An unexpected error occurred!", e);
    }
}
Also used : ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) DeezerApi(api.deezer.DeezerApi) Getter(lombok.Getter) DefaultShardManagerBuilder(net.dv8tion.jda.api.sharding.DefaultShardManagerBuilder) BaringoApiException(com.github.kskelm.baringo.util.BaringoApiException) LoggerFactory(org.slf4j.LoggerFactory) ChangeLogConfig(main.utils.json.changelog.ChangeLogConfig) EventWaiter(com.jagrosh.jdautilities.commons.waiter.EventWaiter) LavalinkLoadBalancer(lavalink.client.io.LavalinkLoadBalancer) SlashCommandManager(main.commands.slashcommands.SlashCommandManager) GuildDBCache(main.utils.database.mongodb.cache.GuildDBCache) GatewayIntent(net.dv8tion.jda.api.requests.GatewayIntent) RobertifyAudioManager(main.audiohandlers.RobertifyAudioManager) SpotifyHttpManager(se.michaelthelin.spotify.SpotifyHttpManager) SkipCommand(main.commands.prefixcommands.audio.SkipCommand) AbstractJSONFile(main.utils.json.AbstractJSONFile) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ReportsEvents(main.commands.prefixcommands.util.reports.ReportsEvents) DiscordBotListAPI(org.discordbots.api.client.DiscordBotListAPI) SuggestionCategoryDeletionEvents(main.events.SuggestionCategoryDeletionEvents) CacheFlag(net.dv8tion.jda.api.utils.cache.CacheFlag) LogChannelEvents(main.events.LogChannelEvents) SpotifyAuthorizationUtils(main.utils.spotify.SpotifyAuthorizationUtils) DedicatedChannelEvents(main.commands.slashcommands.commands.management.dedicatedchannel.DedicatedChannelEvents) MemberCachePolicy(net.dv8tion.jda.api.utils.MemberCachePolicy) ShardManager(net.dv8tion.jda.api.sharding.ShardManager) Logger(org.slf4j.Logger) PollEvents(main.commands.slashcommands.commands.misc.poll.PollEvents) AbstractMongoDatabase(main.utils.database.mongodb.AbstractMongoDatabase) GatewayEncoding(net.dv8tion.jda.api.GatewayEncoding) AnnouncementChannelEvents(main.events.AnnouncementChannelEvents) JdaLavalink(lavalink.client.io.jda.JdaLavalink) Activity(net.dv8tion.jda.api.entities.Activity) GuildMusicManager(main.audiohandlers.GuildMusicManager) MenuPaginationTestCommand(main.commands.prefixcommands.dev.test.MenuPaginationTestCommand) VoiceChannelEvents(main.events.VoiceChannelEvents) Executors(java.util.concurrent.Executors) ResumeUtils(main.utils.resume.ResumeUtils) SpotifyApi(se.michaelthelin.spotify.SpotifyApi) TimeUnit(java.util.concurrent.TimeUnit) Base64(java.util.Base64) DBLApi(main.utils.votes.api.discordbotlist.DBLApi) BaringoClient(com.github.kskelm.baringo.BaringoClient) PaginationEvents(main.utils.pagination.PaginationEvents) ENV(main.constants.ENV) WebUtils(me.duncte123.botcommons.web.WebUtils) ChunkingFilter(net.dv8tion.jda.api.utils.ChunkingFilter) ChangeLogConfig(main.utils.json.changelog.ChangeLogConfig) DefaultShardManagerBuilder(net.dv8tion.jda.api.sharding.DefaultShardManagerBuilder) ReportsEvents(main.commands.prefixcommands.util.reports.ReportsEvents) SpotifyApi(se.michaelthelin.spotify.SpotifyApi) SuggestionCategoryDeletionEvents(main.events.SuggestionCategoryDeletionEvents) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) VoiceChannelEvents(main.events.VoiceChannelEvents) DeezerApi(api.deezer.DeezerApi) LogChannelEvents(main.events.LogChannelEvents) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) GuildMusicManager(main.audiohandlers.GuildMusicManager) SkipCommand(main.commands.prefixcommands.audio.SkipCommand) MenuPaginationTestCommand(main.commands.prefixcommands.dev.test.MenuPaginationTestCommand) DedicatedChannelEvents(main.commands.slashcommands.commands.management.dedicatedchannel.DedicatedChannelEvents) AnnouncementChannelEvents(main.events.AnnouncementChannelEvents) BaringoApiException(com.github.kskelm.baringo.util.BaringoApiException) BaringoClient(com.github.kskelm.baringo.BaringoClient) JdaLavalink(lavalink.client.io.jda.JdaLavalink) PollEvents(main.commands.slashcommands.commands.misc.poll.PollEvents) PaginationEvents(main.utils.pagination.PaginationEvents) SlashCommandManager(main.commands.slashcommands.SlashCommandManager) BaringoApiException(com.github.kskelm.baringo.util.BaringoApiException)

Example 5 with SpotifyApi

use of se.michaelthelin.spotify.SpotifyApi in project aiode by robinfriedli.

the class PlayableFactory method createPlayablesFromSpotifyUrl.

private List<Playable> createPlayablesFromSpotifyUrl(URI uri, SpotifyApi spotifyApi, boolean redirectSpotify) {
    StringList pathFragments = StringList.createWithRegex(uri.getPath(), "/");
    SpotifyService spotifyService = new SpotifyService(spotifyApi);
    if (pathFragments.contains("playlist")) {
        return createPlayableForSpotifyUrlType(pathFragments, "playlist", playlistId -> {
            List<SpotifyTrack> playlistTracks = spotifyService.getPlaylistTracks(playlistId);
            return createPlayables(redirectSpotify, playlistTracks);
        }, spotifyApi);
    } else if (pathFragments.contains("track")) {
        return createPlayableForSpotifyUrlType(pathFragments, "track", trackId -> {
            Track track = spotifyApi.getTrack(trackId).build().execute();
            return Lists.newArrayList(createPlayable(redirectSpotify, track));
        }, spotifyApi);
    } else if (pathFragments.contains("episode")) {
        return createPlayableForSpotifyUrlType(pathFragments, "episode", episodeId -> {
            Episode episode = spotifyApi.getEpisode(episodeId).build().execute();
            return Lists.newArrayList(createPlayable(redirectSpotify, episode));
        }, spotifyApi);
    } else if (pathFragments.contains("album")) {
        return createPlayableForSpotifyUrlType(pathFragments, "album", albumId -> {
            List<Track> albumTracks = spotifyService.getAlbumTracks(albumId);
            return createPlayables(redirectSpotify, albumTracks);
        }, spotifyApi);
    } else if (pathFragments.contains("show")) {
        return createPlayableForSpotifyUrlType(pathFragments, "show", showId -> {
            List<Episode> showEpisodes = spotifyService.getShowEpisodes(showId);
            return createPlayables(redirectSpotify, showEpisodes);
        }, spotifyApi);
    } else {
        throw new InvalidCommandException("Detected Spotify URL but no track, playlist or album id provided.");
    }
}
Also used : StringList(net.robinfriedli.stringlist.StringList) NoResultsFoundException(net.robinfriedli.aiode.exceptions.NoResultsFoundException) YouTubePlaylist(net.robinfriedli.aiode.audio.youtube.YouTubePlaylist) SpotifyInvoker(net.robinfriedli.aiode.function.SpotifyInvoker) SpotifyTrack(net.robinfriedli.aiode.audio.spotify.SpotifyTrack) Episode(se.michaelthelin.spotify.model_objects.specification.Episode) AudioPlaylist(com.sedmelluq.discord.lavaplayer.track.AudioPlaylist) PlayableTrackWrapper(net.robinfriedli.aiode.audio.spotify.PlayableTrackWrapper) Strings(com.google.common.base.Strings) NotFoundException(se.michaelthelin.spotify.exceptions.detailed.NotFoundException) Lists(com.google.common.collect.Lists) HollowYouTubeVideo(net.robinfriedli.aiode.audio.youtube.HollowYouTubeVideo) Map(java.util.Map) YouTubeVideo(net.robinfriedli.aiode.audio.youtube.YouTubeVideo) Track(se.michaelthelin.spotify.model_objects.specification.Track) URI(java.net.URI) SpotifyTrackRedirectionRunnable(net.robinfriedli.aiode.audio.exec.SpotifyTrackRedirectionRunnable) Nullable(javax.annotation.Nullable) Collection(java.util.Collection) InvalidCommandException(net.robinfriedli.aiode.exceptions.InvalidCommandException) ParseException(org.apache.hc.core5.http.ParseException) SpotifyWebApiException(se.michaelthelin.spotify.exceptions.SpotifyWebApiException) IOException(java.io.IOException) Collectors(java.util.stream.Collectors) SpotifyTrackKind(net.robinfriedli.aiode.audio.spotify.SpotifyTrackKind) StandardCharsets(java.nio.charset.StandardCharsets) AudioItem(com.sedmelluq.discord.lavaplayer.track.AudioItem) SpotifyApi(se.michaelthelin.spotify.SpotifyApi) YouTubePlaylistPopulationRunnable(net.robinfriedli.aiode.audio.exec.YouTubePlaylistPopulationRunnable) List(java.util.List) SpotifyService(net.robinfriedli.aiode.audio.spotify.SpotifyService) PlaylistSimplified(se.michaelthelin.spotify.model_objects.specification.PlaylistSimplified) URLEncodedUtils(org.apache.http.client.utils.URLEncodedUtils) AlbumSimplified(se.michaelthelin.spotify.model_objects.specification.AlbumSimplified) AudioTrack(com.sedmelluq.discord.lavaplayer.track.AudioTrack) TrackLoadingExecutor(net.robinfriedli.aiode.audio.exec.TrackLoadingExecutor) NameValuePair(org.apache.http.NameValuePair) UrlTrack(net.robinfriedli.aiode.entities.UrlTrack) Collections(java.util.Collections) YouTubeService(net.robinfriedli.aiode.audio.youtube.YouTubeService) CheckedFunction(net.robinfriedli.aiode.function.CheckedFunction) Episode(se.michaelthelin.spotify.model_objects.specification.Episode) InvalidCommandException(net.robinfriedli.aiode.exceptions.InvalidCommandException) StringList(net.robinfriedli.stringlist.StringList) SpotifyTrack(net.robinfriedli.aiode.audio.spotify.SpotifyTrack) SpotifyService(net.robinfriedli.aiode.audio.spotify.SpotifyService) StringList(net.robinfriedli.stringlist.StringList) List(java.util.List) SpotifyTrack(net.robinfriedli.aiode.audio.spotify.SpotifyTrack) Track(se.michaelthelin.spotify.model_objects.specification.Track) AudioTrack(com.sedmelluq.discord.lavaplayer.track.AudioTrack) UrlTrack(net.robinfriedli.aiode.entities.UrlTrack)

Aggregations

SpotifyApi (se.michaelthelin.spotify.SpotifyApi)6 List (java.util.List)3 SpotifyTrack (net.robinfriedli.aiode.audio.spotify.SpotifyTrack)3 InvalidCommandException (net.robinfriedli.aiode.exceptions.InvalidCommandException)3 Strings (com.google.common.base.Strings)2 Lists (com.google.common.collect.Lists)2 AudioItem (com.sedmelluq.discord.lavaplayer.track.AudioItem)2 AudioTrack (com.sedmelluq.discord.lavaplayer.track.AudioTrack)2 Collection (java.util.Collection)2 Map (java.util.Map)2 Collectors (java.util.stream.Collectors)2 Guild (net.dv8tion.jda.api.entities.Guild)2 PlayableFactory (net.robinfriedli.aiode.audio.PlayableFactory)2 SpotifyTrackKind (net.robinfriedli.aiode.audio.spotify.SpotifyTrackKind)2 YouTubeVideo (net.robinfriedli.aiode.audio.youtube.YouTubeVideo)2 DeezerApi (api.deezer.DeezerApi)1 BaringoClient (com.github.kskelm.baringo.BaringoClient)1 BaringoApiException (com.github.kskelm.baringo.util.BaringoApiException)1 Sets (com.google.api.client.util.Sets)1 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1