DEV Community

梁智鸿
梁智鸿

Posted on

I cleaned 58 subtitle cues with one Python script — and I'm pre-selling the desktop version

Auto-captions lie about what you said.

Whisper / CapCut give you "Um, uh, so, so, I, I think you know, like, we should start with, uh, the budget?"

You actually said "I think we should start with the budget?"

I wrote a single deterministic Python script (standard library only, no AI, no upload) that cleans the SRT you already have: it strips standalone fillers (um/uh/erm/you know, filler "like"), collapses repeats ("the the" -> "the"), re-wraps to 37 chars / 2 lines per cue (the Premiere readability rule), sorts cues and trims timestamp overlaps, strips HTML tags, and normalises whitespace and capitalisation. Timestamps are never changed except for overlap trimming.

I ran it on three sample transcripts (58 cues): 124 filler words removed, 9 repeats collapsed, 58 cues re-wrapped, 13 timestamp issues fixed, 12 HTML tags stripped.

The samples are synthetic files written for the demo, not a real creator's transcript — the counts are real counts from running the script on them.

Try it yourself:

python3 clean_srt.py messy.srt clean.srt before-after.txt counts.json
Enter fullscreen mode Exit fullscreen mode

The script, the rules, and the samples are free and MIT-licensed on GitHub: https://github.com/LZH0713/CleanSRT

The full offline desktop app — batch cleaning, chapter export (clean SRT/VTT + chapters.txt + MP3 chapters), and a GUI instead of the command line — is in pre-sale: $19 early bird for the first 20, $39 regular, full refund if it never ships: https://lzhorizon4.gumroad.com/l/rsmqd

Honest question for podcasters and editors: is hand-writing timestamps (Wideframe puts it at 30–45 min per episode, plus 20–30 min for show notes) a pain you would pay $19 to skip, or do you just live with messy captions?

— CleanSRT

Top comments (0)