# A zero-dependency SRT handoff check for localized product tutorials

> Source: <https://dev.to/_a2923b30009c0d41b7dad/a-zero-dependency-srt-handoff-check-for-localized-product-tutorials-3e6g>
> Published: 2026-11-23 05:31:34+00:00

**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.

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](https://gist.github.com/linan522/825514e0e0f384fdef635a4942aa98da/raw/25c6f05b41e45b2496835ce79e42c2ac246e2757/localization_package_check.py), [ten tests](https://gist.github.com/linan522/825514e0e0f384fdef635a4942aa98da/raw/25c6f05b41e45b2496835ce79e42c2ac246e2757/test_localization_package_check.py), [original SRT fixture](https://gist.github.com/linan522/825514e0e0f384fdef635a4942aa98da/raw/25c6f05b41e45b2496835ce79e42c2ac246e2757/stand-demo_en_v03.srt), [version notes](https://gist.github.com/linan522/825514e0e0f384fdef635a4942aa98da/raw/25c6f05b41e45b2496835ce79e42c2ac246e2757/stand-demo_en_v03.txt), [usage instructions and MIT license](https://gist.github.com/linan522/825514e0e0f384fdef635a4942aa98da) 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:

```
# Extracted from the original accompanying standard-library utility.
# validate_srt() and validate_delivery() are defined in the linked .py file.
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](https://cutnow.ai/en/guides/dub-a-video-in-another-language/) documents one checked Chinese-to-English tutorial MP4/SRT/audio package; its [contextual subtitle guide](https://cutnow.ai/en/guides/translate-subtitles-with-video-context/) 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.*
