Skip to content

Commit

Permalink
Update yt-source
Browse files Browse the repository at this point in the history
  • Loading branch information
davidffa committed Aug 15, 2024
1 parent 073eb8c commit 37c17c3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ import com.sedmelluq.lava.extensions.youtuberotator.planner.*
import com.sedmelluq.lava.extensions.youtuberotator.tools.ip.Ipv4Block
import com.sedmelluq.lava.extensions.youtuberotator.tools.ip.Ipv6Block
import dev.lavalink.youtube.YoutubeAudioSourceManager
import dev.lavalink.youtube.clients.AndroidWithThumbnail
import dev.lavalink.youtube.clients.MusicWithThumbnail
import dev.lavalink.youtube.clients.TvHtml5EmbeddedWithThumbnail
import dev.lavalink.youtube.clients.Web
import dev.lavalink.youtube.clients.WebWithThumbnail
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.Bean
Expand Down Expand Up @@ -102,6 +102,12 @@ class AudioPlayerConfiguration {
}

audioPlayerManager.registerSourceManager(youtube)

val ytConfig = lavaplayerProps.youtubeConfig

if (ytConfig != null) {
Web.setPoTokenAndVisitorData(ytConfig.poToken, ytConfig.visitorData)
}
}

if (sources.soundcloud) audioPlayerManager.registerSourceManager(SoundCloudAudioSourceManager.createDefault(lavaplayerProps.isSoundcloudSearchEnabled))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package lavalink.server.config

class YoutubeConfig {
var email: String? = null
var password: String? = null
var poToken: String? = null
var visitorData: String? = null
}
6 changes: 3 additions & 3 deletions application.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ lavalink:
odyseeSearchEnabled: true
soundcloudSearchEnabled: true
yandexMusicSearchEnabled: true
#youtubeConfig: (Youtube account credentials, needed to play age restricted tracks)
#email: ""
#password: ""
#youtubeConfig: (Bypass yt bot detection, get them here https://github.com/iv-org/youtube-trusted-session-generator)
#poToken: ""
#visitorData: ""
# You can get your yandex oauth token here https://music-yandex-bot.ru/ used to remove the 30s limit on some tracks
#yandexOAuthToken:
#ratelimit:
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ project(":Lavalink-Server").projectDir = File("$rootDir/LavalinkServer")
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
version("kotlin", "2.0.0")
version("kotlin", "2.0.10")
version("koe", "f2c8267")
version("yt-asm", "1.5.2")
version("yt-asm", "1.6.0")
version("spring", "3.3.2")
version("prometheus", "0.16.0")

Expand Down

0 comments on commit 37c17c3

Please sign in to comment.