fix(lang): surface orig in errors and flag the original audio track over the API

Error messages named the resolved language for a user who only ever defaulted to orig. Audio tracks now carry is_original, resolved through Tracks.by_language so it agrees with the downloader.
This commit is contained in:
imSp4rky
2026-07-26 18:22:46 -06:00
parent b74b64825e
commit 8bacb247ee
6 changed files with 146 additions and 14 deletions
+5
View File
@@ -175,6 +175,11 @@ def find_missing_langs(
return [tok for tok in requested if tok not in skip and not match_func(tok, available)]
def as_requested(tokens: Sequence[str], orig_token: Optional[str]) -> str:
"""Return language tokens as the user wrote them, so 'orig' reads as 'orig' and not the language it resolved to."""
return ", ".join("orig" if tok == orig_token else tok for tok in tokens)
def get_boxes(data: bytes, box_type: bytes, as_bytes: bool = False) -> Box: # type: ignore
"""
Scan a byte array for a wanted MP4/ISOBMFF box, then parse and yield each find.