Skip to content

Instantly share code, notes, and snippets.

@Snow-Pyon
Created December 30, 2017 03:41
Show Gist options
  • Save Snow-Pyon/2e2b1ff0f7480c47d91c62bccab94fd0 to your computer and use it in GitHub Desktop.
Save Snow-Pyon/2e2b1ff0f7480c47d91c62bccab94fd0 to your computer and use it in GitHub Desktop.
on script load:
import "com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager"
import "com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeSearchProvider"
import "ch.njol.skript.variables.Variables"
set {_yt-audio-manager} to new {YoutubeAudioSourceManager}(true)
set {kurisu::instances::yt-search-provider} to new YoutubeSearchProvider({_yt-audio-manager})
effect search (youtube|yt)track %string% and store results in [list] {<(.+)>::*}:
set {_query} to expression-1
set {_result} to {kurisu::instances::yt-search-provider}.loadSearchResult({_query})
set {_tracks::*} to ...{_result}.getTracks()
loop {_tracks::*}:
{Variables}.setVariable("%regex-1%::%loop-value.getIdentifier()%", event and whether regex-1 starts with "_".);
# TODO: SoundCloud search
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment