{"slug": "a-zero-dependency-srt-handoff-check-for-localized-product-tutorials", "title": "A zero-dependency SRT handoff check for localized product tutorials", "summary": "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.", "body_md": "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.\n\nCutNow, 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.\n\nThe 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:\n\n`.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.\nThe `project_en_v03` pattern is our illustrative naming convention, not a requirement imposed by platforms or CutNow.\n\nHere's the key idea from the script:\n\n```\n# Extracted from the original accompanying standard-library utility.\n# validate_srt() and validate_delivery() are defined in the linked .py file.\nfrom pathlib import Path\nfrom localization_package_check import validate_srt, validate_delivery\n\nsrt = Path(\"stand-demo_en_v03.srt\")\nreport = validate_srt(srt, max_duration_ms=20_000)\nvalidate_delivery(srt, None, None, Path(\"stand-demo_en_v03.txt\"))\nprint(report.count, report.last_end_ms)\n```\n\nThe package includes a fully usable CLI so you don't have to import it:\n\n```\npython localization_package_check.py --srt stand-demo_en_v03.srt \\\n  --max-duration 00:00:20,000 --notes stand-demo_en_v03.txt\npython -m unittest -v test_localization_package_check\n```\n\nExpected CLI summary for the included original text fixture:\n\n```\nPASS: UTF-8 SRT; 3 cues; strictly increasing, non-overlapping times; last end 00:00:17,200.\nPASS: duration bound 00:00:20,000.\nPASS: delivery stem stand-demo_en_v03 (notes; names and notes only).\nNOTE: Not a media, pronunciation, semantic, synchronization, or CutNow product test.\n```\n\nThe 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.\n\nImagine 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.\n\nIn 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.\n\nRun 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.\n\nCutNow'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.\n\n*Disclosure: CutNow team; AI-assisted article. The utility and tests are independently prepared examples and were run locally, not inside CutNow.*", "url": "https://wpnews.pro/news/a-zero-dependency-srt-handoff-check-for-localized-product-tutorials", "canonical_source": "https://dev.to/_a2923b30009c0d41b7dad/a-zero-dependency-srt-handoff-check-for-localized-product-tutorials-3e6g", "published_at": "2026-11-23 05:31:34+00:00", "updated_at": "2026-11-23 05:41:41.281567+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["CutNow", "Python"], "also_reported_by": [], "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.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/a-zero-dependency-srt-handoff-check-for-localized-product-tutorials", "markdown": "https://wpnews.pro/news/a-zero-dependency-srt-handoff-check-for-localized-product-tutorials.md", "text": "https://wpnews.pro/news/a-zero-dependency-srt-handoff-check-for-localized-product-tutorials.txt", "jsonld": "https://wpnews.pro/news/a-zero-dependency-srt-handoff-check-for-localized-product-tutorials.jsonld"}}