Skip to content

Commit 8a8299d

Browse files
committed
Catch No supported audio streams and try next client.
1 parent dc725b2 commit 8a8299d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "dev.lavalink.youtube"
7-
version = "1.0.1"
7+
version = "1.0.2"
88

99
allprojects {
1010
group = rootProject.group

common/src/main/java/dev/lavalink/youtube/track/YoutubeAudioTrack.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void process(LocalAudioTrackExecutor localExecutor) throws Exception {
6464
return; // stream played through successfully, short-circuit.
6565
} catch (FriendlyException e) {
6666
// usually thrown by getPlayabilityStatus when loading formats.
67-
// these aren't considered fatal so we just store them and continue.
67+
// these aren't considered fatal, so we just store them and continue.
6868
lastException = e;
6969
} catch (RuntimeException e) {
7070
// store exception so it can be thrown if we run out of clients to
@@ -73,7 +73,8 @@ public void process(LocalAudioTrackExecutor localExecutor) throws Exception {
7373
String message = e.getMessage();
7474

7575
if ("Not success status code: 403".equals(message) ||
76-
"Invalid status code for player api response: 400".equals(message)) {
76+
"Invalid status code for player api response: 400".equals(message) ||
77+
message.contains("No supported audio streams available")) {
7778
continue; // try next client
7879
}
7980

common/src/main/java/dev/lavalink/youtube/track/format/TrackFormats.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public StreamFormat getBestFormat() {
4444
if (bestFormat == null) {
4545
StringJoiner joiner = new StringJoiner(", ");
4646
formats.forEach(format -> joiner.add(format.getType().toString()));
47-
throw new IllegalStateException("No supported audio streams available, available types: " + joiner);
47+
throw new RuntimeException("No supported audio streams available, available types: " + joiner);
4848
}
4949

5050
return bestFormat;

0 commit comments

Comments
 (0)