Skip to content

Fix the Youtube Auto Local Language Download Bug for Automatic format.#2334

Open
itisdb wants to merge 1 commit intoJunkFood02:mainfrom
itisdb:main
Open

Fix the Youtube Auto Local Language Download Bug for Automatic format.#2334
itisdb wants to merge 1 commit intoJunkFood02:mainfrom
itisdb:main

Conversation

@itisdb
Copy link

@itisdb itisdb commented Dec 5, 2025

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.

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.
Copilot AI review requested due to automatic review settings December 5, 2025 07:57
@itisdb
Copy link
Author

itisdb commented Dec 5, 2025

Fixes #2332

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-multistreams option for automatic format selection in video downloads
  • Added --audio-multistreams option 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")
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copilot uses AI. Check for mistakes.
}
} else {
applyFormatSorter(preferences, toAudioFormatSorter())
addOption("--audio-multistreams")
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant