From 4ea899ba69211b98f55010bc8b818cd419c8c274 Mon Sep 17 00:00:00 2001 From: devoxin Date: Tue, 23 Apr 2024 00:30:57 +0100 Subject: [PATCH] Ignore loading of LL/WL/LM playlists as they require a user --- build.gradle.kts | 2 +- .../dev/lavalink/youtube/YoutubeAudioSourceManager.java | 6 +++++- .../src/main/resources/lavalink-plugins/youtube.properties | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 56d5cf6..7bded6a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } group = "dev.lavalink.youtube" -version = "1.0.3" +version = "1.0.4" allprojects { group = rootProject.group diff --git a/common/src/main/java/dev/lavalink/youtube/YoutubeAudioSourceManager.java b/common/src/main/java/dev/lavalink/youtube/YoutubeAudioSourceManager.java index cc3bcfb..7f034cc 100644 --- a/common/src/main/java/dev/lavalink/youtube/YoutubeAudioSourceManager.java +++ b/common/src/main/java/dev/lavalink/youtube/YoutubeAudioSourceManager.java @@ -250,7 +250,11 @@ protected Router routeFromVideoId(@NotNull HttpInterface httpInterface, return (client) -> client.loadMix(this, httpInterface, playlistId, trimmedId); } - return (client) -> client.loadPlaylist(this, httpInterface, playlistId, trimmedId); + if (!playlistId.startsWith("LL") && // Liked videos (requires logged-in user) + !playlistId.startsWith("WL") && // Watch later (requires logged-in user) + !playlistId.startsWith("LM")) { // Liked music (requires logged-in user) + return (client) -> client.loadPlaylist(this, httpInterface, playlistId, trimmedId); + } } return (client) -> client.loadVideo(this, httpInterface, trimmedId); diff --git a/plugin/src/main/resources/lavalink-plugins/youtube.properties b/plugin/src/main/resources/lavalink-plugins/youtube.properties index f8fcb54..43c6a1e 100644 --- a/plugin/src/main/resources/lavalink-plugins/youtube.properties +++ b/plugin/src/main/resources/lavalink-plugins/youtube.properties @@ -1,3 +1,3 @@ name=youtube path=dev.lavalink.youtube.plugin -version=1.0.3 +version=1.0.4