Basic Troubleshooting
Version of youtube-source
f45bbb7 (same code path on main, 2be8e54)
The search query/queries, URL(s), playlist ID(s)/URL(s) or video ID(s)/URL(s) that triggered the issue
https://www.youtube.com/shorts/etEhNKZQbhg
Code Example
N/A, happens with a plain Lavalink setup. Just play the video above.
Exception and Stacktrace
N/A, nothing is thrown. The track plays fine, it's just the wrong audio track.
What is your client configuration?
MUSIC, IOS, WEB, WEBEMBEDDED, ANDROID_VR
Hey! Videos that have YouTube's auto-dubbed audio tracks play the English dub instead of the original audio. It mostly shows up on spoken stuff like podcasts, vlogs and Shorts. The one above is a Spanish Short, and Lavalink plays it in English.
From what I can tell, when a video has several audio tracks YouTube marks the one matching the requester's language as audioIsDefault. We don't send hl, so YouTube assumes English and the English dub comes back as the default. TrackFormats.getBestFormat() skips every format that isn't the default track, so the dub is what ends up playing.
Here's what the IOS client returns for etEhNKZQbhg (itag 140):
| audioTrack.id |
displayName |
audioIsDefault |
| en-US.10 |
English (US) |
true |
| es-US.4 |
Spanish (US) original |
false |
Sending hl doesn't really fix it, it just moves the problem around: with hl=es, an English video like v9QtM6qnG50 gets its Spanish dub as the default instead. yt-dlp handles this by preferring the track whose name says "original" (and skipping audio-description tracks), then falling back to the default.
This was originally reported on my bot's tracker, albertgmz/BeatDock#160, which has the full write-up and the patch. I tried that approach locally. StreamFormat gets an isOriginalAudioTrack flag, both format extractors (common and v2) set it from audioTrack.displayName, and getBestFormat() prefers original tracks, falling back to the current behaviour when none is marked. Single-track videos and English originals come out the same as before, and the Spanish Short plays in Spanish. It applies cleanly to main and comes with two unit tests. Happy to open a PR if you're fine with that direction.
Basic Troubleshooting
Version of youtube-source
f45bbb7 (same code path on main, 2be8e54)
The search query/queries, URL(s), playlist ID(s)/URL(s) or video ID(s)/URL(s) that triggered the issue
https://www.youtube.com/shorts/etEhNKZQbhg
Code Example
Exception and Stacktrace
What is your client configuration?
MUSIC, IOS, WEB, WEBEMBEDDED, ANDROID_VR
Hey! Videos that have YouTube's auto-dubbed audio tracks play the English dub instead of the original audio. It mostly shows up on spoken stuff like podcasts, vlogs and Shorts. The one above is a Spanish Short, and Lavalink plays it in English.
From what I can tell, when a video has several audio tracks YouTube marks the one matching the requester's language as
audioIsDefault. We don't sendhl, so YouTube assumes English and the English dub comes back as the default.TrackFormats.getBestFormat()skips every format that isn't the default track, so the dub is what ends up playing.Here's what the IOS client returns for
etEhNKZQbhg(itag 140):Sending
hldoesn't really fix it, it just moves the problem around: withhl=es, an English video likev9QtM6qnG50gets its Spanish dub as the default instead. yt-dlp handles this by preferring the track whose name says "original" (and skipping audio-description tracks), then falling back to the default.This was originally reported on my bot's tracker, albertgmz/BeatDock#160, which has the full write-up and the patch. I tried that approach locally.
StreamFormatgets anisOriginalAudioTrackflag, both format extractors (commonandv2) set it fromaudioTrack.displayName, andgetBestFormat()prefers original tracks, falling back to the current behaviour when none is marked. Single-track videos and English originals come out the same as before, and the Spanish Short plays in Spanish. It applies cleanly to main and comes with two unit tests. Happy to open a PR if you're fine with that direction.