Skip to content

Commit 4109155

Browse files
authored
Bump lavaplayer (#683)
* Bump lavaplayer * Email and pass not necessary * 1.3.98.1
1 parent ba57574 commit 4109155

File tree

5 files changed

+28
-25
lines changed

5 files changed

+28
-25
lines changed

LavalinkServer/application.yml.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ lavalink:
2626
#strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
2727
#searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
2828
#retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times
29-
#youtubeConfig: # Required for avoiding age restrictions by YouTube. Guide https://github.com/Walkyst/lavaplayer-fork/issues/18
30-
#PAPISID: ""
31-
#PSID: ""
29+
#youtubeConfig: # Required for avoiding all age restrictions by YouTube, some restricted videos still can be played without.
30+
#email: "" # Email of Google account
31+
#password: "" # Password of Google account
3232
#httpConfig: # Useful for blocking bad-actors from ip-grabbing your music node and attacking it, this way only the http proxy will be attacked
3333
#proxyHost: "localhost" # Hostname of the proxy, (ip or domain)
3434
#proxyPort: 3128 # Proxy port, 3128 is the default for squidProxy

LavalinkServer/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,9 @@ dependencies {
5151
exclude group: "org.slf4j", module: "slf4j-api"
5252
}
5353
implementation group: 'moe.kyokobot.koe', name: 'ext-udpqueue', version: koeVersion
54-
implementation group: 'com.github.walkyst', name: 'lavaplayer-fork', version: lavaplayerVersion
54+
implementation group: 'com.github.walkyst.lavaplayer-fork', name: 'lavaplayer', version: lavaplayerVersion
55+
implementation group: 'com.github.walkyst.lavaplayer-fork', name: 'lavaplayer-ext-youtube-rotator', version: lavaplayerVersion
5556

56-
//implementation group: 'com.sedmelluq', name: 'lavaplayer', version: lavaplayerVersion
57-
implementation(group: 'com.sedmelluq', name: 'lavaplayer-ext-youtube-rotator', version: lavaplayerIpRotatorVersion) {
58-
exclude group: 'com.sedmelluq', module: 'lavaplayer'
59-
}
6057
implementation group: 'com.github.natanbc', name: 'lavadsp', version: lavaDspVersion
6158
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlinVersion
6259

LavalinkServer/src/main/java/lavalink/server/config/AudioPlayerConfiguration.kt

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,25 @@ class AudioPlayerConfiguration {
7979
val mcr: MediaContainerRegistry = MediaContainerRegistry.extended(*mediaContainerProbes.toTypedArray())
8080

8181
if (sources.isYoutube) {
82-
val youtube = YoutubeAudioSourceManager(serverConfig.isYoutubeSearchEnabled)
82+
val youtubeConfig = serverConfig.youtubeConfig
83+
val youtube: YoutubeAudioSourceManager
84+
if (youtubeConfig != null) {
85+
if (youtubeConfig.email.isBlank() && youtubeConfig.password.isBlank()) {
86+
log.info("Email and password fields are blank, some age restricted videos will throw exceptions")
87+
}
88+
youtube = YoutubeAudioSourceManager(
89+
serverConfig.isYoutubeSearchEnabled,
90+
youtubeConfig.email,
91+
youtubeConfig.password
92+
)
93+
} else {
94+
youtube = YoutubeAudioSourceManager(
95+
serverConfig.isYoutubeSearchEnabled,
96+
"",
97+
""
98+
)
99+
log.debug("Youtube config block is not found")
100+
}
83101
if (routePlanner != null) {
84102
val retryLimit = serverConfig.ratelimit?.retryLimit ?: -1
85103
when {
@@ -93,18 +111,6 @@ class AudioPlayerConfiguration {
93111
val playlistLoadLimit = serverConfig.youtubePlaylistLoadLimit
94112
if (playlistLoadLimit != null) youtube.setPlaylistPageCount(playlistLoadLimit)
95113

96-
val youtubeConfig = serverConfig.youtubeConfig
97-
if (youtubeConfig != null) {
98-
if (youtubeConfig.PAPISID.isNotBlank() && youtubeConfig.PSID.isNotBlank()) {
99-
YoutubeHttpContextFilter.setPAPISID(youtubeConfig.PAPISID)
100-
YoutubeHttpContextFilter.setPSID(youtubeConfig.PSID)
101-
} else {
102-
log.info("PAPISID and PSID fields are blank, age restricted videos will throw exceptions")
103-
}
104-
} else {
105-
log.debug("Youtube config block is not found")
106-
}
107-
108114
audioPlayerManager.registerSourceManager(youtube)
109115
}
110116
if (sources.isSoundcloud) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package lavalink.server.config
22

33
data class YoutubeConfig(
4-
var PAPISID: String = "",
5-
var PSID: String = ""
4+
var email: String = "",
5+
var password: String = ""
66
)

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ subprojects {
5353

5454
ext {
5555
//@formatter:off
56-
57-
lavaplayerVersion = '1.3.97.1'
56+
57+
lavaplayerVersion = '1.3.98.1'
5858
lavaplayerIpRotatorVersion = '0.2.3'
5959
jdaNasVersion = '1.1.0'
6060
jappVersion = '1.3.2-MINN'

0 commit comments

Comments
 (0)