fix: Originalsprache bei Videos mit KI-synchronisierten Tonspuren
Gefunden mit einem englischen Video (0LmCveTM788): ohne -l wurde Arabisch gewählt, denn jede der 20 Synchron-Tonspuren hat eine eigene „-orig“-Spur. - original_language(): aus „language“, sonst Tonspur mit „original“, sonst die einzige „-orig“-Spur - Automatische Untertitel nur in der Originalsprache (keine Synchronisation) - Sprachen auch mit Region: „en“ findet manuelle Untertitel „en-US“ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7e6ffa5899
commit
547dcb358d
1 changed files with 108 additions and 19 deletions
|
|
@ -46,6 +46,19 @@ def test_default_language_is_original_audio(fake_yt_dlp, tmp_path, monkeypatch,
|
|||
assert [p.name for p in tmp_path.iterdir()] == ["output.txt"]
|
||||
|
||||
|
||||
def test_default_language_ignores_dubbed_tracks(fake_yt_dlp, tmp_path, monkeypatch):
|
||||
info = {
|
||||
"id": "dub", "language": "en-US", "subtitles": {"en-US": []},
|
||||
"automatic_captions": {"ar-orig": [], "en-orig": []},
|
||||
}
|
||||
run = fake_yt_dlp(info, vtt=VTT)
|
||||
monkeypatch.setattr(yt.subprocess, "run", run)
|
||||
run_main(monkeypatch, "-u", URL, "-o", tmp_path / "out.txt")
|
||||
download = run.calls[1]
|
||||
assert download[download.index("--sub-langs") + 1] == "en-US"
|
||||
assert "--write-subs" in download
|
||||
|
||||
|
||||
def test_fliesstext(fake_yt_dlp, tmp_path, monkeypatch, capsys):
|
||||
long_vtt = "WEBVTT\n\n" + "".join(
|
||||
f"00:00:{i:02d}.000 --> 00:00:{i + 1:02d}.000\nSatz Nummer {i} zum EU-Gipfel.\n\n"
|
||||
|
|
|
|||
Loading…
Reference in a new issue