Skip to content

Commit e66ec36

Browse files
committed
Fix itag 18 playback
1 parent 07180c1 commit e66ec36

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,12 @@ private void processWithClient(LocalAudioTrackExecutor localExecutor,
131131
FormatWithUrl augmentedFormat = loadBestFormatWithUrl(httpInterface, client);
132132
log.debug("Starting track with URL from client {}: {}", client.getIdentifier(), augmentedFormat.signedUrl);
133133

134+
String query = augmentedFormat.signedUrl.getRawQuery();
135+
boolean isLegacyFormat = query != null && query.contains("itag=18");
136+
boolean isStream = trackInfo.isStream || (!isLegacyFormat && augmentedFormat.format.getContentLength() == CONTENT_LENGTH_UNKNOWN);
137+
134138
try {
135-
if (trackInfo.isStream || augmentedFormat.format.getContentLength() == CONTENT_LENGTH_UNKNOWN) {
139+
if (isStream) {
136140
processStream(localExecutor, httpInterface, augmentedFormat);
137141
} else {
138142
processStatic(localExecutor, httpInterface, augmentedFormat, streamPosition);

0 commit comments

Comments
 (0)