|
diff --git a/authoring/andy/transcript/README.md b/authoring/andy/transcript/README.md |
|
index 3fd1add0..2886d65a 100644 |
|
--- a/authoring/andy/transcript/README.md |
|
+++ b/authoring/andy/transcript/README.md |
|
@@ -171,7 +171,7 @@ The Zoom files use the folder name as their base: |
|
|
|
Zoom files appear in the same order. Name collisions receive `-2`, `-3`, and later suffixes. |
|
|
|
-A local file run creates `<timestamp>-<filename-without-extension>` under the output parent, with `-2`, `-3`, and later suffixes for collisions. It uses the generic `meta.txt` and `raw_*` names. Its metadata records the absolute source path. An enabled summary uses the selected bundled prompt, as for YouTube. |
|
+A local file run creates `<timestamp>-<filename-without-extension>` under the output parent, with `-2`, `-3`, and later suffixes for collisions. Long stems are shortened at a UTF8 character boundary to fit a 255-byte directory component, reserving room for `-999`. It uses the generic `meta.txt` and `raw_*` names. Its metadata keeps the complete absolute source path. An enabled summary uses the selected bundled prompt, as for YouTube. |
|
|
|
The metadata holds the title, date, and source from the moment the folder appears. Each stage rewrites it, so it always shows how far the run got: |
|
|
|
@@ -241,6 +241,7 @@ uv run <skill_dir>/scripts/transcript.py --help |
|
uv run <skill_dir>/scripts/transcript.py run youtube --help |
|
uv run <skill_dir>/scripts/transcript.py run zoom --help |
|
uv run <skill_dir>/scripts/transcript.py list prompts |
|
+uv run <skill_dir>/scripts/transcript.py run file --help |
|
uv run <skill_dir>/scripts/transcript.py list profiles |
|
uv run <skill_dir>/scripts/transcript.py list models --provider claude |
|
uv run <skill_dir>/scripts/transcript.py list models --provider codex |
|
diff --git a/authoring/andy/transcript/SKILL.md b/authoring/andy/transcript/SKILL.md |
|
index cc0d7dd3..33e2349f 100644 |
|
--- a/authoring/andy/transcript/SKILL.md |
|
+++ b/authoring/andy/transcript/SKILL.md |
|
@@ -55,7 +55,7 @@ For Zoom, `--path` names the meeting folder, not its `audio*.m4a` file. A plain |
|
|
|
## Change a prompt |
|
|
|
-Each YouTube prompt is a Markdown file in `references/prompts/`, and its file name without `.md` is the `--prompt` value. Edit a file there to change a prompt, or add a `.md` file to create one; `list prompts` shows it. In a managed installation, edit the source package, because the next install overwrites installed copies. |
|
+Each bundled prompt is a Markdown file in `references/prompts/`, and its file name without `.md` is the `--prompt` value. Edit a file there to change a prompt, or add a `.md` file to create one; `list prompts` shows it. In a managed installation, edit the source package, because the next install overwrites installed copies. |
|
|
|
Only `summary_with_quotes` receives the timestamped transcript; every other prompt receives plain text. Zoom summaries use the `synthese-rencontre` prompt from andy-mode's `distill-prompt` route. |
|
|
|
diff --git a/authoring/andy/transcript/scripts/tests/test_cli.py b/authoring/andy/transcript/scripts/tests/test_cli.py |
|
index 72b89812..a6ce4627 100644 |
|
--- a/authoring/andy/transcript/scripts/tests/test_cli.py |
|
+++ b/authoring/andy/transcript/scripts/tests/test_cli.py |
|
@@ -217,7 +217,16 @@ class TestDryRun: |
|
assert audio.read_bytes() == b"audio" |
|
|
|
@pytest.mark.parametrize( |
|
- "kind", ["missing", "directory", "empty", "blank", "omitted"] |
|
+ "kind", |
|
+ [ |
|
+ "missing", |
|
+ "directory", |
|
+ "empty", |
|
+ "blank", |
|
+ "omitted", |
|
+ "unknown-home", |
|
+ "symlink-loop", |
|
+ ], |
|
) |
|
def test_invalid_local_audio_fails_before_preflight( |
|
self, kind, monkeypatch, tmp_path, capsys |
|
@@ -229,10 +238,17 @@ class TestDryRun: |
|
audio.mkdir() |
|
elif kind == "empty": |
|
audio.touch() |
|
+ elif kind == "symlink-loop": |
|
+ audio.symlink_to(audio) |
|
+ path_text = ( |
|
+ "~__transcript_missing_user_efc1__/audio.m4a" |
|
+ if kind == "unknown-home" |
|
+ else str(audio) |
|
+ ) |
|
selection = ( |
|
[] |
|
if kind == "omitted" |
|
- else ["--path", "" if kind == "blank" else str(audio)] |
|
+ else ["--path", "" if kind == "blank" else path_text] |
|
) |
|
monkeypatch.setattr( |
|
transcript, |
|
@@ -240,17 +256,17 @@ class TestDryRun: |
|
lambda *_args: pytest.fail("invalid source read a secret"), |
|
) |
|
|
|
- assert ( |
|
- transcript.main(["run", "file", *selection, "--no-summary", "--dry-run"]) |
|
- == 2 |
|
- ) |
|
+ assert transcript.main(["run", "file", *selection, "--no-summary"]) == 2 |
|
|
|
out, err = capsys.readouterr() |
|
assert out == "" |
|
result = json.loads(err) |
|
assert result["ok"] is False |
|
assert result["help"] == "transcript run file --help" |
|
- assert "--path" in result["errors"][0] |
|
+ if kind == "omitted": |
|
+ assert result["errors"] == ["the following arguments are required: --path"] |
|
+ else: |
|
+ assert result["errors"][0].startswith("run file ") |
|
|
|
def test_a_dry_run_answers_its_plan_without_preflight( |
|
self, monkeypatch, capsys |
|
diff --git a/authoring/andy/transcript/scripts/tests/test_contract.py b/authoring/andy/transcript/scripts/tests/test_contract.py |
|
index cdf75fd0..f9741395 100644 |
|
--- a/authoring/andy/transcript/scripts/tests/test_contract.py |
|
+++ b/authoring/andy/transcript/scripts/tests/test_contract.py |
|
@@ -45,6 +45,7 @@ COMMANDS: dict[tuple[str, ...], dict[int, str]] = { |
|
("run",): transcript.EXIT_CODES, |
|
("run", "youtube"): transcript.EXIT_CODES, |
|
("run", "zoom"): transcript.EXIT_CODES, |
|
+ ("run", "file"): transcript.EXIT_CODES, |
|
("list",): transcript.LIST_EXIT_CODES, |
|
("list", "prompts"): transcript.LIST_EXIT_CODES, |
|
("list", "profiles"): transcript.LIST_EXIT_CODES, |
|
diff --git a/authoring/andy/transcript/scripts/tests/test_transcript.py b/authoring/andy/transcript/scripts/tests/test_transcript.py |
|
index fd38e388..c76e2108 100644 |
|
--- a/authoring/andy/transcript/scripts/tests/test_transcript.py |
|
+++ b/authoring/andy/transcript/scripts/tests/test_transcript.py |
|
@@ -2213,9 +2213,23 @@ class TestYouTubeAuthenticationOrder: |
|
|
|
|
|
class TestFilePipeline: |
|
- @pytest.mark.parametrize("http_status", [200, 500]) |
|
+ @pytest.mark.parametrize( |
|
+ "http_status,file_name", |
|
+ [ |
|
+ (200, "Entrevue à Montréal.m4a"), |
|
+ (500, "Entrevue à Montréal.m4a"), |
|
+ (200, "é" * 117 + "a.m4a"), |
|
+ (200, "é" * 119 + ".m4a"), |
|
+ ], |
|
+ ids=[ |
|
+ "normal-success", |
|
+ "http-failure", |
|
+ "collision-239-bytes", |
|
+ "first-run-242-bytes", |
|
+ ], |
|
+ ) |
|
def test_successful_file_pipeline( |
|
- self, http_status, tmp_path, monkeypatch, capsys |
|
+ self, http_status, file_name, tmp_path, monkeypatch, capsys |
|
) -> None: |
|
from datetime import UTC, datetime |
|
|
|
@@ -2234,7 +2248,7 @@ class TestFilePipeline: |
|
monkeypatch.setattr( |
|
transcript, "get_api_key_from_keyring", lambda *_args: "dummy-key" |
|
) |
|
- audio = tmp_path / "Entrevue à Montréal.m4a" |
|
+ audio = tmp_path / file_name |
|
payload = b"local-audio" * 20_000 |
|
audio.write_bytes(payload) |
|
exports = tmp_path / "exports" |
|
@@ -2256,6 +2270,7 @@ class TestFilePipeline: |
|
) |
|
|
|
monkeypatch.setattr(transcript.httpx, "post", post) |
|
+ base_name = "" |
|
for suffix in ("", "-2", "-3"): |
|
code = transcript.main( |
|
[ |
|
@@ -2269,7 +2284,22 @@ class TestFilePipeline: |
|
] |
|
) |
|
out, err = capsys.readouterr() |
|
- folder = exports / f"2026_10_27_12h34_56-Entrevue à Montréal{suffix}" |
|
+ assert code == (0 if http_status == 200 else 1), err |
|
+ result = json.loads(out if http_status == 200 else err.splitlines()[-1]) |
|
+ folder = Path(result["files"][0]).parent |
|
+ assert folder.parent == exports |
|
+ if not suffix: |
|
+ base_name = folder.name |
|
+ prefix = "2026_10_27_12h34_56-" |
|
+ assert base_name.startswith(prefix) |
|
+ output_stem = base_name[len(prefix) :] |
|
+ assert output_stem and audio.stem.startswith(output_stem) |
|
+ if file_name == "Entrevue à Montréal.m4a": |
|
+ assert output_stem == "Entrevue à Montréal" |
|
+ else: |
|
+ assert len(audio.name.encode("utf-8")) in {239, 242} |
|
+ assert folder.name == f"{base_name}{suffix}" |
|
+ assert len(folder.name.encode("utf-8")) <= 255 |
|
assert folder.is_dir() |
|
assert audio.read_bytes() == payload |
|
meta = (folder / "meta.txt").read_text(encoding="utf-8") |
|
@@ -2278,7 +2308,6 @@ class TestFilePipeline: |
|
if http_status == 200: |
|
assert code == 0 |
|
assert err == f"{folder}\n" |
|
- result = json.loads(out) |
|
assert result["ok"] is True |
|
assert {Path(path).name for path in result["files"]} == { |
|
"meta.txt", |
|
@@ -2305,7 +2334,6 @@ class TestFilePipeline: |
|
else: |
|
assert code == 1 |
|
assert out == "" |
|
- result = json.loads(err.splitlines()[-1]) |
|
assert result["ok"] is False |
|
assert result["files"] == [str(folder / "meta.txt")] |
|
assert "500" in result["errors"][0] |
|
@@ -2314,6 +2342,7 @@ class TestFilePipeline: |
|
Path(path).name for path in result["files"] |
|
} |
|
assert uploads == [4, 4, 4] |
|
+ assert len(base_name.encode("utf-8")) <= 255 - len("-999") |
|
|
|
|
|
class TestPipelines: |
|
diff --git a/authoring/andy/transcript/scripts/transcript.py b/authoring/andy/transcript/scripts/transcript.py |
|
index 76e192e8..53d19aba 100644 |
|
--- a/authoring/andy/transcript/scripts/transcript.py |
|
+++ b/authoring/andy/transcript/scripts/transcript.py |
|
@@ -7,7 +7,7 @@ |
|
# "rich", |
|
# ] |
|
# /// |
|
-"""Transcribe YouTube or Zoom audio with Deepgram and optionally summarize it.""" |
|
+"""Transcribe YouTube, Zoom, or local audio with Deepgram and optionally summarize it.""" |
|
|
|
# >>> cli-block: canonical copy in scripts/_cli.py; do not edit a pasted copy |
|
import argparse |
|
@@ -2253,7 +2253,7 @@ def build_parser() -> TranscriptParser: |
|
prompts = _command_parser( |
|
resources, |
|
"prompts", |
|
- help_text="List bundled YouTube prompts", |
|
+ help_text="List bundled transcript prompts", |
|
description="List bundled prompt names and their transcript input type.", |
|
epilog="""examples: |
|
transcript list prompts |
|
@@ -2779,7 +2779,7 @@ def _validate_source_selection(plan: RunPlan, args: argparse.Namespace) -> None: |
|
f"run file requires a non-empty audio file: {audio_path}", |
|
replacement, |
|
) |
|
- except OSError as error: |
|
+ except (OSError, RuntimeError) as error: |
|
raise SourceCLIError( |
|
f"run file could not read the audio path: {error}", replacement |
|
) from error |
|
@@ -2857,7 +2857,13 @@ def _create_result_folder( |
|
base_name = f"{date_formatted}_{clean_title(asset.title)}_{asset.video_id}" |
|
elif plan.source_kind == "file": |
|
output_root = (args.output_dir or OUTPUT_DIR).expanduser() |
|
- base_name = f"{started.strftime('%Y_%m_%d_%Hh%M_%S')}-{asset.audio_path.stem}" |
|
+ prefix = f"{started.strftime('%Y_%m_%d_%Hh%M_%S')}-" |
|
+ # Leave room for make_unique_dir's largest suffix within a 255-byte component. |
|
+ stem_budget = 255 - len(prefix.encode("utf-8")) - len("-999") |
|
+ stem = asset.audio_path.stem.encode("utf-8")[:stem_budget].decode( |
|
+ "utf-8", errors="ignore" |
|
+ ) |
|
+ base_name = f"{prefix}{stem}" |
|
else: |
|
if asset.meeting_dir is None: |
|
raise RuntimeError("Zoom source is missing its meeting directory") |
|
diff --git a/skills/transcript/README.md b/skills/transcript/README.md |
|
index 3fd1add0..2886d65a 100644 |
|
--- a/skills/transcript/README.md |
|
+++ b/skills/transcript/README.md |
|
@@ -171,7 +171,7 @@ The Zoom files use the folder name as their base: |
|
|
|
Zoom files appear in the same order. Name collisions receive `-2`, `-3`, and later suffixes. |
|
|
|
-A local file run creates `<timestamp>-<filename-without-extension>` under the output parent, with `-2`, `-3`, and later suffixes for collisions. It uses the generic `meta.txt` and `raw_*` names. Its metadata records the absolute source path. An enabled summary uses the selected bundled prompt, as for YouTube. |
|
+A local file run creates `<timestamp>-<filename-without-extension>` under the output parent, with `-2`, `-3`, and later suffixes for collisions. Long stems are shortened at a UTF8 character boundary to fit a 255-byte directory component, reserving room for `-999`. It uses the generic `meta.txt` and `raw_*` names. Its metadata keeps the complete absolute source path. An enabled summary uses the selected bundled prompt, as for YouTube. |
|
|
|
The metadata holds the title, date, and source from the moment the folder appears. Each stage rewrites it, so it always shows how far the run got: |
|
|
|
@@ -241,6 +241,7 @@ uv run <skill_dir>/scripts/transcript.py --help |
|
uv run <skill_dir>/scripts/transcript.py run youtube --help |
|
uv run <skill_dir>/scripts/transcript.py run zoom --help |
|
uv run <skill_dir>/scripts/transcript.py list prompts |
|
+uv run <skill_dir>/scripts/transcript.py run file --help |
|
uv run <skill_dir>/scripts/transcript.py list profiles |
|
uv run <skill_dir>/scripts/transcript.py list models --provider claude |
|
uv run <skill_dir>/scripts/transcript.py list models --provider codex |
|
diff --git a/skills/transcript/SKILL.md b/skills/transcript/SKILL.md |
|
index cc0d7dd3..33e2349f 100644 |
|
--- a/skills/transcript/SKILL.md |
|
+++ b/skills/transcript/SKILL.md |
|
@@ -55,7 +55,7 @@ For Zoom, `--path` names the meeting folder, not its `audio*.m4a` file. A plain |
|
|
|
## Change a prompt |
|
|
|
-Each YouTube prompt is a Markdown file in `references/prompts/`, and its file name without `.md` is the `--prompt` value. Edit a file there to change a prompt, or add a `.md` file to create one; `list prompts` shows it. In a managed installation, edit the source package, because the next install overwrites installed copies. |
|
+Each bundled prompt is a Markdown file in `references/prompts/`, and its file name without `.md` is the `--prompt` value. Edit a file there to change a prompt, or add a `.md` file to create one; `list prompts` shows it. In a managed installation, edit the source package, because the next install overwrites installed copies. |
|
|
|
Only `summary_with_quotes` receives the timestamped transcript; every other prompt receives plain text. Zoom summaries use the `synthese-rencontre` prompt from andy-mode's `distill-prompt` route. |
|
|
|
diff --git a/skills/transcript/scripts/tests/test_cli.py b/skills/transcript/scripts/tests/test_cli.py |
|
index 72b89812..a6ce4627 100644 |
|
--- a/skills/transcript/scripts/tests/test_cli.py |
|
+++ b/skills/transcript/scripts/tests/test_cli.py |
|
@@ -217,7 +217,16 @@ class TestDryRun: |
|
assert audio.read_bytes() == b"audio" |
|
|
|
@pytest.mark.parametrize( |
|
- "kind", ["missing", "directory", "empty", "blank", "omitted"] |
|
+ "kind", |
|
+ [ |
|
+ "missing", |
|
+ "directory", |
|
+ "empty", |
|
+ "blank", |
|
+ "omitted", |
|
+ "unknown-home", |
|
+ "symlink-loop", |
|
+ ], |
|
) |
|
def test_invalid_local_audio_fails_before_preflight( |
|
self, kind, monkeypatch, tmp_path, capsys |
|
@@ -229,10 +238,17 @@ class TestDryRun: |
|
audio.mkdir() |
|
elif kind == "empty": |
|
audio.touch() |
|
+ elif kind == "symlink-loop": |
|
+ audio.symlink_to(audio) |
|
+ path_text = ( |
|
+ "~__transcript_missing_user_efc1__/audio.m4a" |
|
+ if kind == "unknown-home" |
|
+ else str(audio) |
|
+ ) |
|
selection = ( |
|
[] |
|
if kind == "omitted" |
|
- else ["--path", "" if kind == "blank" else str(audio)] |
|
+ else ["--path", "" if kind == "blank" else path_text] |
|
) |
|
monkeypatch.setattr( |
|
transcript, |
|
@@ -240,17 +256,17 @@ class TestDryRun: |
|
lambda *_args: pytest.fail("invalid source read a secret"), |
|
) |
|
|
|
- assert ( |
|
- transcript.main(["run", "file", *selection, "--no-summary", "--dry-run"]) |
|
- == 2 |
|
- ) |
|
+ assert transcript.main(["run", "file", *selection, "--no-summary"]) == 2 |
|
|
|
out, err = capsys.readouterr() |
|
assert out == "" |
|
result = json.loads(err) |
|
assert result["ok"] is False |
|
assert result["help"] == "transcript run file --help" |
|
- assert "--path" in result["errors"][0] |
|
+ if kind == "omitted": |
|
+ assert result["errors"] == ["the following arguments are required: --path"] |
|
+ else: |
|
+ assert result["errors"][0].startswith("run file ") |
|
|
|
def test_a_dry_run_answers_its_plan_without_preflight( |
|
self, monkeypatch, capsys |
|
diff --git a/skills/transcript/scripts/tests/test_contract.py b/skills/transcript/scripts/tests/test_contract.py |
|
index cdf75fd0..f9741395 100644 |
|
--- a/skills/transcript/scripts/tests/test_contract.py |
|
+++ b/skills/transcript/scripts/tests/test_contract.py |
|
@@ -45,6 +45,7 @@ COMMANDS: dict[tuple[str, ...], dict[int, str]] = { |
|
("run",): transcript.EXIT_CODES, |
|
("run", "youtube"): transcript.EXIT_CODES, |
|
("run", "zoom"): transcript.EXIT_CODES, |
|
+ ("run", "file"): transcript.EXIT_CODES, |
|
("list",): transcript.LIST_EXIT_CODES, |
|
("list", "prompts"): transcript.LIST_EXIT_CODES, |
|
("list", "profiles"): transcript.LIST_EXIT_CODES, |
|
diff --git a/skills/transcript/scripts/tests/test_transcript.py b/skills/transcript/scripts/tests/test_transcript.py |
|
index fd38e388..c76e2108 100644 |
|
--- a/skills/transcript/scripts/tests/test_transcript.py |
|
+++ b/skills/transcript/scripts/tests/test_transcript.py |
|
@@ -2213,9 +2213,23 @@ class TestYouTubeAuthenticationOrder: |
|
|
|
|
|
class TestFilePipeline: |
|
- @pytest.mark.parametrize("http_status", [200, 500]) |
|
+ @pytest.mark.parametrize( |
|
+ "http_status,file_name", |
|
+ [ |
|
+ (200, "Entrevue à Montréal.m4a"), |
|
+ (500, "Entrevue à Montréal.m4a"), |
|
+ (200, "é" * 117 + "a.m4a"), |
|
+ (200, "é" * 119 + ".m4a"), |
|
+ ], |
|
+ ids=[ |
|
+ "normal-success", |
|
+ "http-failure", |
|
+ "collision-239-bytes", |
|
+ "first-run-242-bytes", |
|
+ ], |
|
+ ) |
|
def test_successful_file_pipeline( |
|
- self, http_status, tmp_path, monkeypatch, capsys |
|
+ self, http_status, file_name, tmp_path, monkeypatch, capsys |
|
) -> None: |
|
from datetime import UTC, datetime |
|
|
|
@@ -2234,7 +2248,7 @@ class TestFilePipeline: |
|
monkeypatch.setattr( |
|
transcript, "get_api_key_from_keyring", lambda *_args: "dummy-key" |
|
) |
|
- audio = tmp_path / "Entrevue à Montréal.m4a" |
|
+ audio = tmp_path / file_name |
|
payload = b"local-audio" * 20_000 |
|
audio.write_bytes(payload) |
|
exports = tmp_path / "exports" |
|
@@ -2256,6 +2270,7 @@ class TestFilePipeline: |
|
) |
|
|
|
monkeypatch.setattr(transcript.httpx, "post", post) |
|
+ base_name = "" |
|
for suffix in ("", "-2", "-3"): |
|
code = transcript.main( |
|
[ |
|
@@ -2269,7 +2284,22 @@ class TestFilePipeline: |
|
] |
|
) |
|
out, err = capsys.readouterr() |
|
- folder = exports / f"2026_10_27_12h34_56-Entrevue à Montréal{suffix}" |
|
+ assert code == (0 if http_status == 200 else 1), err |
|
+ result = json.loads(out if http_status == 200 else err.splitlines()[-1]) |
|
+ folder = Path(result["files"][0]).parent |
|
+ assert folder.parent == exports |
|
+ if not suffix: |
|
+ base_name = folder.name |
|
+ prefix = "2026_10_27_12h34_56-" |
|
+ assert base_name.startswith(prefix) |
|
+ output_stem = base_name[len(prefix) :] |
|
+ assert output_stem and audio.stem.startswith(output_stem) |
|
+ if file_name == "Entrevue à Montréal.m4a": |
|
+ assert output_stem == "Entrevue à Montréal" |
|
+ else: |
|
+ assert len(audio.name.encode("utf-8")) in {239, 242} |
|
+ assert folder.name == f"{base_name}{suffix}" |
|
+ assert len(folder.name.encode("utf-8")) <= 255 |
|
assert folder.is_dir() |
|
assert audio.read_bytes() == payload |
|
meta = (folder / "meta.txt").read_text(encoding="utf-8") |
|
@@ -2278,7 +2308,6 @@ class TestFilePipeline: |
|
if http_status == 200: |
|
assert code == 0 |
|
assert err == f"{folder}\n" |
|
- result = json.loads(out) |
|
assert result["ok"] is True |
|
assert {Path(path).name for path in result["files"]} == { |
|
"meta.txt", |
|
@@ -2305,7 +2334,6 @@ class TestFilePipeline: |
|
else: |
|
assert code == 1 |
|
assert out == "" |
|
- result = json.loads(err.splitlines()[-1]) |
|
assert result["ok"] is False |
|
assert result["files"] == [str(folder / "meta.txt")] |
|
assert "500" in result["errors"][0] |
|
@@ -2314,6 +2342,7 @@ class TestFilePipeline: |
|
Path(path).name for path in result["files"] |
|
} |
|
assert uploads == [4, 4, 4] |
|
+ assert len(base_name.encode("utf-8")) <= 255 - len("-999") |
|
|
|
|
|
class TestPipelines: |
|
diff --git a/skills/transcript/scripts/transcript.py b/skills/transcript/scripts/transcript.py |
|
index 76e192e8..53d19aba 100644 |
|
--- a/skills/transcript/scripts/transcript.py |
|
+++ b/skills/transcript/scripts/transcript.py |
|
@@ -7,7 +7,7 @@ |
|
# "rich", |
|
# ] |
|
# /// |
|
-"""Transcribe YouTube or Zoom audio with Deepgram and optionally summarize it.""" |
|
+"""Transcribe YouTube, Zoom, or local audio with Deepgram and optionally summarize it.""" |
|
|
|
# >>> cli-block: canonical copy in scripts/_cli.py; do not edit a pasted copy |
|
import argparse |
|
@@ -2253,7 +2253,7 @@ def build_parser() -> TranscriptParser: |
|
prompts = _command_parser( |
|
resources, |
|
"prompts", |
|
- help_text="List bundled YouTube prompts", |
|
+ help_text="List bundled transcript prompts", |
|
description="List bundled prompt names and their transcript input type.", |
|
epilog="""examples: |
|
transcript list prompts |
|
@@ -2779,7 +2779,7 @@ def _validate_source_selection(plan: RunPlan, args: argparse.Namespace) -> None: |
|
f"run file requires a non-empty audio file: {audio_path}", |
|
replacement, |
|
) |
|
- except OSError as error: |
|
+ except (OSError, RuntimeError) as error: |
|
raise SourceCLIError( |
|
f"run file could not read the audio path: {error}", replacement |
|
) from error |
|
@@ -2857,7 +2857,13 @@ def _create_result_folder( |
|
base_name = f"{date_formatted}_{clean_title(asset.title)}_{asset.video_id}" |
|
elif plan.source_kind == "file": |
|
output_root = (args.output_dir or OUTPUT_DIR).expanduser() |
|
- base_name = f"{started.strftime('%Y_%m_%d_%Hh%M_%S')}-{asset.audio_path.stem}" |
|
+ prefix = f"{started.strftime('%Y_%m_%d_%Hh%M_%S')}-" |
|
+ # Leave room for make_unique_dir's largest suffix within a 255-byte component. |
|
+ stem_budget = 255 - len(prefix.encode("utf-8")) - len("-999") |
|
+ stem = asset.audio_path.stem.encode("utf-8")[:stem_budget].decode( |
|
+ "utf-8", errors="ignore" |
|
+ ) |
|
+ base_name = f"{prefix}{stem}" |
|
else: |
|
if asset.meeting_dir is None: |
|
raise RuntimeError("Zoom source is missing its meeting directory") |