babysor/MockingBird · error · ValueError
No valid cues parsed from SRT.
Error message
No valid cues parsed from SRT.
What it means
ValueError raised by parse_srt when no cue with non-empty text was successfully extracted from the file. Even if the file had blocks, all were skipped because their text lines were empty, so there is nothing to render.
Solutions
- Inspect the SRT structure: numbered index, timestamp line, text line, blank separator per block
- Verify the file is the intended subtitle and non-trivial
- Regenerate the SRT from its source (transcription/translation tool)
Defensive patterns
Strategy: validation
Validate before calling
content = Path(srt).read_text(encoding='utf-8', errors='replace')
assert content.count('-->') > 0, 'no cue ranges found in SRT' Try / catch
try:
cues = parse_srt(path)
except ValueError:
sys.exit(f'{path} has no usable cues; check formatting') Prevention
- Spot-check SRT structure before rendering
- Regenerate from source when in doubt
- Verify upstream transcription produced output
When it happens
Trigger: An SRT containing only blank text lines per cue, a file whose block regex never matched (wrong formatting/blank-line separators), or an effectively empty file that still read successfully.
Common situations: Placeholder SRT generated by a failed upstream transcription step, CRLF/blank-line issues preventing block detection, or pointing --srt at the wrong file.
Related errors
AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27).
Data as JSON: /api/errors/d1159c6bba915a7f.
Report an issue: GitHub.
Appendix: source
Thrown at skills/speak/scripts/render_timeline.py:87
cues: List[Cue] = []
for block in blocks:
lines = [ln.rstrip() for ln in block.splitlines() if ln.strip()]
if len(lines) < 3:
continue
try:
idx = int(lines[0])
except ValueError:
continue
if "-->" not in lines[1]:
continue
start_raw, end_raw = [s.strip() for s in lines[1].split("-->", 1)]
start_ms = parse_timestamp_ms(start_raw)
end_ms = parse_timestamp_ms(end_raw)
text = "\n".join(lines[2:]).strip()
if text:
cues.append(Cue(index=idx, start_ms=start_ms, end_ms=end_ms, text=text))
if not cues:
raise ValueError("No valid cues parsed from SRT.")
return cues
# ── Voice map resolution ─────────────────────────────────────────────
def parse_segment_key(key: str) -> Tuple[int, int]:
key = key.strip()
if "-" in key:
left, right = key.split("-", 1)
return int(left), int(right)
v = int(key)
return v, v
def resolve_segment_cfg(index: int, config: Dict[str, Any]) -> Dict[str, Any]:
merged = dict(config.get("default", {}))
for key, seg_cfg in config.get("segments", {}).items():View on GitHub (pinned to 28dc5e14f1)