cd /news/developer-tools/a-zero-dependency-srt-handoff-check-… · home › topics › developer-tools › article
[ARTICLE · art-174514] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

A zero-dependency SRT handoff check for localized product tutorials

A developer published a zero-dependency Python 3.10+ utility that validates localized video tutorial packages by checking SRT timing (UTF-8 encoding, increasing non-overlapping cue ranges, a configurable duration bound) and matching delivery filenames, version notes, and release/language/version fields. The standard-library checker ships with ten unit tests and a CLI, and the author explicitly scopes it to file hygiene rather than media, pronunciation, semantic, or synchronization verification.

key takeaway

A standard-library Python 3.10+ checker can catch SRT timing and package-naming errors—UTF-8/BOM handling, inverted or overlapping cues, a max_duration_ms bound, and mismatched release_stem/language/version fields—before human review of meaning and sync.

by read3 min views7 publishedNov 23, 2026

Translating a video isn't a CSV operation. Suppose you already have a Chinese product tutorial and are preparing the same picture edit with an English dub and English subtitles. The subtitles can be valid text and still belong to the wrong audio take. A shared release name helps catch that; a timing check catches a different class of preventable mistakes.

CutNow, an AI video editor for existing footage, connects translated voice, corresponding timed subtitles, and the video delivery in its localization workflow. Editorial review still has to check the meaning, pronunciation, and the action on screen. The code below is a separate, original Python utility for the narrower file-hygiene problem. It is not CutNow code, does not call its product, and doesn't inspect the contents of video or audio files.

The complete standard-library checker, ten tests, original SRT fixture, version notes, usage instructions and MIT license are publicly available in the companion Gist. Requires Python 3.10 or newer; the local checks ran with Python 3.12. It uses only Python's standard library and checks:

.srt (a leading UTF-8 BOM is accepted).HH:MM:SS,mmm --> HH:MM:SS,mmm ranges, increasing start/end times, nonempty captions, and no overlapping cue ranges. The no-overlap rule is a 00:00:20,000..txt version-note existence, compatible extensions, shared basenames, and matching release_stem, language, and version fields. The project_en_v03 pattern is our illustrative naming convention, not a requirement imposed by platforms or CutNow.

Here's the key idea from the script:

from pathlib import Path
from localization_package_check import validate_srt, validate_delivery

srt = Path("stand-demo_en_v03.srt")
report = validate_srt(srt, max_duration_ms=20_000)
validate_delivery(srt, None, None, Path("stand-demo_en_v03.txt"))
print(report.count, report.last_end_ms)

The package includes a fully usable CLI so you don't have to import it:

python localization_package_check.py --srt stand-demo_en_v03.srt \
  --max-duration 00:00:20,000 --notes stand-demo_en_v03.txt
python -m unittest -v test_localization_package_check

Expected CLI summary for the included original text fixture:

PASS: UTF-8 SRT; 3 cues; strictly increasing, non-overlapping times; last end 00:00:17,200.
PASS: duration bound 00:00:20,000.
PASS: delivery stem stand-demo_en_v03 (notes; names and notes only).
NOTE: Not a media, pronunciation, semantic, synchronization, or CutNow product test.

The ten self-tests intentionally cover UTF-8 rejection, overlaps, inverted times, non-increasing times, duration overrun, cue indices, matching package names, and mismatched versions. The test suite creates empty placeholder media filenames solely to exercise filename validation; it does not assert that those placeholders contain real video.

Imagine a fictional adjustable-stand tutorial: first loosen a knob, then raise the arm, then tighten the knob. An English sentence can have perfect grammar yet arrive after the viewer has moved on to the next action. That calls for a human looking at the video, not a parser.

In practice, I would request stand-demo_en_v03.mp4, stand-demo_en_v03.srt, and an optional stand-demo_en_v03.m4a, together with stand-demo_en_v03.txt identifying the approved picture master. The checker can catch accidental v04 audio names in a v03 folder. It cannot compare audio waveforms, prove that words match the picture, verify subtitle track embedding, or infer missing captions from gaps.

Run the script before handoff, then have a target-language reviewer play the complete tutorial and check the opening, each action boundary, and ending. Listen without text, read without audio, and finally inspect the exported version in the destination player. Fix the affected voice and subtitle assets together if a translation changes.

CutNow's public dubbing/delivery guide documents one checked Chinese-to-English tutorial MP4/SRT/audio package; its contextual subtitle guide focuses on conditions, names, and timing. That public product evidence is separate from the tests of this independent script. The imaginary stand example was not run through CutNow.

Disclosure: CutNow team; AI-assisted article. The utility and tests are independently prepared examples and were run locally, not inside CutNow.

── more in #developer-tools 4 stories · sorted by recency
── more on @cutnow 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/a-zero-dependency-sr…] indexed:0 read:3min 2026-11-23 · —