feat: fix and improve auto-selection for default dubbed audio language#3748
Merged
ImprovedTube merged 1 commit intocode-charity:masterfrom Apr 2, 2026
Merged
feat: fix and improve auto-selection for default dubbed audio language#3748ImprovedTube merged 1 commit intocode-charity:masterfrom
ImprovedTube merged 1 commit intocode-charity:masterfrom
Conversation
Member
|
hi and thank you so much! @Pieko16 Sorry using our menu was or appeared comparably complicated here We should document what is 'player_' for or don't need it. 'disabled' can automatically remove the variable from storage (Please consider to come back in future, a follow up PR or so.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the issue where the "Default Dubbed Language" setting failed to automatically switch the video's audio track.
Technical Root Cause
The previous implementation was attempting to read
languageCodefrom thegetLanguageInfo()object. Through debugging, it was discovered that YouTube's Player API does not providelanguageCodefor audio tracks (it is only available for text/caption tracks). Audio tracks store their language identifiers in theidproperty (e.g., "en.1", "tr"). Because the code was looking for a non-existent property, the matching logic always failed.Changes & Improvements
info.languageCodetoinfo.idto correctly identify the track language.enor prefixed IDs likeen.1anden-US).setTimeoutcalls with asetIntervalpolling mechanism. It now attempts to switch the track every 300ms (up to 10 tries) to ensure the player is fully initialized and tracks are loaded.trySelectTrackfunction for better stability and error handling.Linked Issue
Fixes #3747