Skip to content

Commit

Permalink
doc: Update Docs for Lavalink plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
hmathieu31 committed Oct 29, 2024
1 parent 37b9acc commit 1d9b4cb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
46 changes: 28 additions & 18 deletions Lavalink/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ lavalink:
soundcloudSearchEnabled: true
gc-warnings: true
#ratelimit:
#ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks
#excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink
#strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
#searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
#retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times
#ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks
#excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink
#strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
#searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
#retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times
#youtubeConfig: # Required for avoiding all age restrictions by YouTube, some restricted videos still can be played without.
#email: "" # Email of Google account
#password: "" # Password of Google account
#email: "" # Email of Google account
#password: "" # Password of Google account
#httpConfig: # Useful for blocking bad-actors from ip-grabbing your music node and attacking it, this way only the http proxy will be attacked
#proxyHost: "localhost" # Hostname of the proxy, (ip or domain)
#proxyPort: 3128 # Proxy port, 3128 is the default for squidProxy
#proxyUser: "" # Optional user for basic authentication fields, leave blank if you don't use basic auth
#proxyPassword: "" # Password for basic authentication
#proxyHost: "localhost" # Hostname of the proxy, (ip or domain)
#proxyPort: 3128 # Proxy port, 3128 is the default for squidProxy
#proxyUser: "" # Optional user for basic authentication fields, leave blank if you don't use basic auth
#proxyPassword: "" # Password for basic authentication

plugins:
- dependency: 'com.github.topi314.lavasearch:lavasearch-plugin:1.0.0'
- dependency: "com.github.topi314.lavasearch:lavasearch-plugin:1.0.0"
snapshot: false # Set to true if you want to use a snapshot version.
- dependency: "com.github.topi314.lavasrc:lavasrc-plugin:4.0.1"
- dependency: "com.github.topi314.lavasrc:lavasrc-plugin:4.2.0"
snapshot: false # Set to true if you want to use a snapshot version.
- dependency: "dev.lavalink.youtube:youtube-plugin:1.1.0"
- dependency: "dev.lavalink.youtube:youtube-plugin:1.8.1"
snapshot: false # Set to true if you want to use a snapshot version.

metrics:
Expand All @@ -82,6 +82,7 @@ logging:
level:
root: INFO
lavalink: INFO
dev.lavalink.youtube.http.YoutubeOauth2Handler: INFO

request:
enabled: true
Expand All @@ -91,14 +92,16 @@ logging:
includePayload: true
maxPayloadLength: 10000


logback:
rollingpolicy:
max-file-size: 1GB
max-history: 30

plugins:
lavasrc:
providers:
- 'ytsearch:"%ISRC%"' # Will be ignored if track does not have an ISRC. See https://en.wikipedia.org/wiki/International_Standard_Recording_Code
- "ytsearch:%QUERY%" # Will be used if track has no ISRC or no track could be found for the ISRC
sources:
spotify: true # Enable Spotify source
applemusic: false # Enable Apple Music source
Expand All @@ -112,12 +115,19 @@ plugins:
countryCode: "FR"
playlistLoadLimit: 6 # The number of pages at 100 tracks each
albumLoadLimit: 6 # The number of pages at 50 tracks each

youtube:
enabled: true # Whether this source can be used.
allowSearch: true # Whether "ytsearch:" and "ytmsearch:" can be used.
allowDirectVideoIds: true # Whether just video IDs can match. If false, only complete URLs will be loaded.
allowDirectPlaylistIds: true # Whether just playlist IDs can match. If false, only complete URLs will be loaded.
oauth:
enabled: true
# refreshToken: "passed through environment variable PLUGINS_YOUTUBE_OAUTH_REFRESHTOKEN - defined after a successful OAuth2 Device Code flow"
# skipInitialization: true # Set as true through environment variable PLUGINS_YOUTUBE_OAUTH_SKIPINITIALIZATION - defined after a successful OAuth2 Device Code flow
# The clients to use for track loading. See below for a list of valid clients.
# Clients are queried in the order they are given (left-to-right)
clients: ["MUSIC", "ANDROID", "WEB"]
clients:
- WEB
- MUSIC
- ANDROID_TESTSUITE
- TVHTML5EMBEDDED
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ This section assumes Docker is used to start the Bot and its dependency.
- Create a Discord App and generate a bot token at [Discord Developer](https://discord.com/developers/applications).
- Connect Bot to a server
- Permissions include: [Slash Commands, Send Messages, Connect, Speak]
- To test playback from Spotify, an Spotify Application must be created with a generated client secret [Spotify Developer](https://developer.spotify.com/dashboard)
- To test track search from Spotify, an Spotify Application must be created with a generated client secret [Spotify Developer](https://developer.spotify.com/dashboard).

> ⚠️ **Note**: Spotify source is a track search source, not a streaming source. Music streaming of Spotify tracks still requires Youtube as a source.
- To limit Youtube API blocks on bots, a "Proof of Origin Token" may be generated and passed into config and help limiting 403 errors. See [Lavalink Youtube Plugin](https://github.com/lavalink-devs/youtube-source?tab=readme-ov-file#using-a-potoken)

### Installation

Expand Down Expand Up @@ -69,7 +73,7 @@ This section assumes Docker is used to start the Bot and its dependency.
--env-file ./Lavalink/.env \
-v $(pwd)/Lavalink/application.yml:/opt/Lavalink/application.yml \
-p 2333:2333 \
ghcr.io/lavalink-devs/lavalink:4
ghcr.io/lavalink-devs/lavalink:<lavalink-version>
```

5. Enter your generated token in User Secrets (In Visual Studio, VS Code with [extension](https://marketplace.visualstudio.com/items?itemName=adrianwilczynski.user-secrets), or through environment variables) and add lavalink config
Expand Down

0 comments on commit 1d9b4cb

Please sign in to comment.