Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

fix: face analysis crash when transcript has no speaker labels (#11)

Nika Siradzee5a00fdae52d
diff --git a/backend/services/face_analysis.py b/backend/services/face_analysis.py
index 8eb6e0b..17fe762 100644
--- a/backend/services/face_analysis.py
+++ b/backend/services/face_analysis.py
@@ -305,7 +305,7 @@ def analyze_faces(
speaker_mappings[top_2[1]] = 1 - speaker_mappings[top_2[0]]
# Extra speakers → dominant speaker's cluster
- dominant_idx = speaker_mappings.get(speakers_by_talk[0], 0)
+ dominant_idx = speaker_mappings.get(speakers_by_talk[0], 0) if speakers_by_talk else 0
for sp in speakers_by_talk[2:]:
speaker_mappings[sp] = dominant_idx
elif len(clusters_list) >= 2 and len(speakers) >= 2:
diff --git a/backend/services/transcription.py b/backend/services/transcription.py
index 3dde47d..69f7493 100644
--- a/backend/services/transcription.py
+++ b/backend/services/transcription.py
@@ -9,6 +9,7 @@ Produces word-level timestamps with speaker labels by:
import os
import subprocess
+import sys
import tempfile
from typing import Optional, Callable