feat: Standard-Dateiname aus Kanal, Titel und Datum des Videos
- yt_untertitel.default_name(): <Kanal>_<Titel>_<Datum>, z. B. John_Mearsheimer_Offensive_Realism_Episode_1_Origins_of_the_War_In_Ukraine_2026-07-30 - Bindestriche/Punkte im Wort bleiben, Kanal max. 40, Titel max. 60 Zeichen an Wortgrenze; ohne Kanal und Titel die Video-ID - Gilt ohne -o/-n in extract_text.py (statt output.txt), yt_untertitel.py und rede_korrigieren.py -u (statt Video-ID) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
fb9201b721
commit
3d9a5037c2
1 changed files with 105 additions and 29 deletions
|
|
@ -17,6 +17,8 @@ VTT = (
|
|||
GERMAN_VIDEO = {
|
||||
"id": "abc123",
|
||||
"title": "Eine Rede",
|
||||
"channel": "Kanal",
|
||||
"upload_date": "20260328",
|
||||
"subtitles": {"en": []},
|
||||
"automatic_captions": {"de-orig": [], "de": [], "en": []},
|
||||
}
|
||||
|
|
@ -36,14 +38,14 @@ def test_default_language_is_original_audio(fake_yt_dlp, tmp_path, monkeypatch,
|
|||
monkeypatch.chdir(tmp_path)
|
||||
run_main(monkeypatch, "-u", URL)
|
||||
|
||||
text = (tmp_path / "output.txt").read_text(encoding="utf-8")
|
||||
text = (tmp_path / "Kanal_Eine_Rede_2026-03-28.txt").read_text(encoding="utf-8")
|
||||
assert text == "Guten Abend.\nSchön, dass Sie da sind.\n"
|
||||
assert "de-orig" in run.calls[1]
|
||||
assert "--write-auto-subs" in run.calls[1]
|
||||
out = capsys.readouterr().out
|
||||
assert "output.txt (2 Zeilen, 7 Wörter)" in out
|
||||
assert "Kanal_Eine_Rede_2026-03-28.txt (2 Zeilen, 7 Wörter)" in out
|
||||
# Only the text file remains, no VTT
|
||||
assert [p.name for p in tmp_path.iterdir()] == ["output.txt"]
|
||||
assert [p.name for p in tmp_path.iterdir()] == ["Kanal_Eine_Rede_2026-03-28.txt"]
|
||||
|
||||
|
||||
def test_default_language_ignores_dubbed_tracks(fake_yt_dlp, tmp_path, monkeypatch):
|
||||
|
|
|
|||
Loading…
Reference in a new issue