Skip to content

Commit

Permalink
MEDIA_CONNECT cannot search
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed May 17, 2024
1 parent 44ec1fb commit 2795267
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ Currently, the following clients are available for use:
- Appears to have restrictions similar to that of `ANDROID_TESTSUITE` except livestreams which appear
to be playable with this client.
- `MEDIA_CONNECT`
- This client seems to be cipher-less, with Opus formats, possibly an extension of Android.
There are also restrictions with this client, including but possibly not limited to, the inability
to load playlists.
- This client has restrictions imposed, including but possibly not limited to:
- Unable to load playlists.
- Unable to use search.
- `IOS`
- This client does not receive Opus formats, so transcoding is required. This can
increase resource consumption. It is recommended not to use this client unless it has
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.lavalink.youtube.clients;

import com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface;
import dev.lavalink.youtube.YoutubeAudioSourceManager;
import dev.lavalink.youtube.clients.skeleton.StreamingNonMusicClient;
import org.jetbrains.annotations.NotNull;

Expand All @@ -25,7 +26,7 @@ public String getPlayerParams() {
public boolean canHandleRequest(@NotNull String identifier) {
// This client appears to be able to load livestreams and videos, but will
// receive 400 bad request when loading playlists.
return !identifier.contains("list=") && super.canHandleRequest(identifier);
return !identifier.startsWith(YoutubeAudioSourceManager.SEARCH_PREFIX) && !identifier.contains("list=") && super.canHandleRequest(identifier);
}

@Override
Expand Down

0 comments on commit 2795267

Please sign in to comment.