Fix the Youtube Auto Local Language Download Bug for Automatic format.#2334
Fix the Youtube Auto Local Language Download Bug for Automatic format.#2334itisdb wants to merge 1 commit intoJunkFood02:mainfrom
Conversation
The issue is that when "Format: automatic" is selected, yt-dlp picks the "best" audio track. Due to YouTube's multi-language audio feature and the user's VPN usage, yt-dlp (or YouTube) defaults to a dubbed audio track instead of the original English one.
To fix this, I've updated DownloadUtil.kt to include the --audio-multistreams option when the download format is set to "Automatic" (which corresponds to an empty formatIdString). This forces yt-dlp to download and merge all available audio streams into the output file. This ensures that the original audio track is included, allowing the user to select the correct language in their media player.
I applied this fix to both:
- Audio Downloads (addOptionsForAudioDownloads): This directly addresses the user's report ("Set Audio").
- Video Downloads (addOptionsForVideoDownloads): To ensure consistency and prevent the same issue when downloading videos.
|
Fixes #2332 |
There was a problem hiding this comment.
Pull request overview
This PR addresses a YouTube multi-language audio bug where yt-dlp selects a dubbed audio track instead of the original language when using automatic format selection. The fix adds the --audio-multistreams option to download all available audio streams, allowing users to select their preferred language in their media player.
- Added
--audio-multistreamsoption for automatic format selection in video downloads - Added
--audio-multistreamsoption for automatic format selection in audio downloads (when audio conversion is disabled)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } else { | ||
| applyFormatSorter(this, toFormatSorter()) | ||
| addOption("--audio-multistreams") |
There was a problem hiding this comment.
Consider adding a comment explaining why --audio-multistreams is added for automatic format selection. This option downloads all available audio streams which increases file size but ensures multi-language audio tracks are preserved (especially important for YouTube's multi-language audio feature).
For example:
// Download all audio streams to preserve multi-language tracks (e.g., original + dubbed audio)
addOption("--audio-multistreams")| } | ||
| } else { | ||
| applyFormatSorter(preferences, toAudioFormatSorter()) | ||
| addOption("--audio-multistreams") |
There was a problem hiding this comment.
Consider adding a comment explaining why --audio-multistreams is added for automatic format selection. This option downloads all available audio streams which increases file size but ensures multi-language audio tracks are preserved (especially important for YouTube's multi-language audio feature).
For example:
// Download all audio streams to preserve multi-language tracks (e.g., original + dubbed audio)
addOption("--audio-multistreams")
The issue is that when "Format: automatic" is selected, yt-dlp picks the "best" audio track. Due to YouTube's multi-language audio feature and the user's VPN usage, yt-dlp (or YouTube) defaults to a dubbed audio track instead of the original English one.
To fix this, I've updated DownloadUtil.kt to include the --audio-multistreams option when the download format is set to "Automatic" (which corresponds to an empty formatIdString). This forces yt-dlp to download and merge all available audio streams into the output file. This ensures that the original audio track is included, allowing the user to select the correct language in their media player.
I applied this fix to both: