From f64f795557506c10b76086cc3cf89193b72afe4f Mon Sep 17 00:00:00 2001 From: Devoxin Date: Sun, 22 Sep 2024 22:28:35 +0100 Subject: [PATCH] Always throw on bad playabilityStatus if status != null, TVHTML5EMBEDDED's isEmbedded() should return true. --- .../java/dev/lavalink/youtube/clients/TvHtml5Embedded.java | 5 +++++ .../lavalink/youtube/clients/skeleton/NonMusicClient.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/dev/lavalink/youtube/clients/TvHtml5Embedded.java b/common/src/main/java/dev/lavalink/youtube/clients/TvHtml5Embedded.java index bf4e91b..073687b 100644 --- a/common/src/main/java/dev/lavalink/youtube/clients/TvHtml5Embedded.java +++ b/common/src/main/java/dev/lavalink/youtube/clients/TvHtml5Embedded.java @@ -77,6 +77,11 @@ protected void extractPlaylistTracks(@NotNull JsonBrowser json, } } + @Override + public boolean isEmbedded() { + return true; + } + @Override @NotNull public String getPlayerParams() { diff --git a/common/src/main/java/dev/lavalink/youtube/clients/skeleton/NonMusicClient.java b/common/src/main/java/dev/lavalink/youtube/clients/skeleton/NonMusicClient.java index 50d2d39..afdbcc5 100644 --- a/common/src/main/java/dev/lavalink/youtube/clients/skeleton/NonMusicClient.java +++ b/common/src/main/java/dev/lavalink/youtube/clients/skeleton/NonMusicClient.java @@ -106,7 +106,8 @@ protected JsonBrowser loadTrackInfoFromInnertube(@NotNull YoutubeAudioSourceMana JsonBrowser json = loadJsonResponse(httpInterface, request, "player api response"); JsonBrowser playabilityJson = json.get("playabilityStatus"); - PlayabilityStatus playabilityStatus = getPlayabilityStatus(playabilityJson, false); + // fix: Make this method throw if a status was supplied (typically when we recurse). + PlayabilityStatus playabilityStatus = getPlayabilityStatus(playabilityJson, status != null); // All other branches should've been caught by getPlayabilityStatus(). // An exception will be thrown if we can't handle it.