Repository navigation
Conversation
Auto-dubbed YouTube videos expose one `-orig` ASR track per audio language. In auto mode, select_caption overrode the target match with originals[0], so an English video (language en-US) returned the alphabetically first track, ar-orig. Prefer the -orig track matching the target language, falling back to English-first ordering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Auto-dubbed YouTube videos expose one
-origASR track per audio language. For example,cWjS56edaUAlists 20+ tracks:ar-orig,bn-orig,en-orig,ko-orig, and so on.In auto mode,
select_captionfirst narrows the tracks to those matching the target language. It then overrides that match withoriginals[0], the alphabetically first-origtrack. As a result, an English video (yt-dlplanguage: en-US) returned thear-origtranscript.Fix
The override now picks the
-origtrack that matches the target language. If none matches, it falls back to the existing English-first ordering. Provenance staysunknownwhen several-origtracks exist, because metadata alone doesn't prove which one is the source.Tests
test_auto_dubbed_video_picks_original_matching_metadatacovering metadataen-US,ko, and none. All three cases fail onmain(they returnar-orig) and pass with this change.select_captionon the realcWjS56edaUAinfo JSON now returnsen-originstead ofar-orig.🤖 Generated with Claude Code