SRT-PROCESS(1)
β¨ NAME β¨
srt-process β the SRT subtitle processing tool π
π DESCRIPTION π
okay bestie so first things first, here's the whole invocation vibe:
usage: srt process [-h] [--input FILE] [--output FILE] [--inplace]
[--no-strict] [--debug] [--ignore-parsing-errors] [--encoding
ENCODING] -f FUNC [-m MODULE]
Process subtitle text content using arbitrary Python code. yes literally, you get to run your own Python on it. main character energy fr fr π¦
πΈ options:
-h,--helpβ show this help message and exit. the classic, the icon, the one you always run first π--input FILE,-i FILEβ the file to process (default: stdin). give it a file or it just reads whatever you pipe in, no thoughts head empty π--output FILE,-o FILEβ the file to write to (default: stdout) β¨--inplace,-pβ modify file in place. it edits the file right there, no copy left behind, be brave π--no-strictβ allow blank lines in output. your media player may explode π like that's the actual warning, don't say nobody told you--debugβ enable debug logging. turn it on when you want to see everything π--ignore-parsing-errors,-cβ try to keep going, even if there are parsing errors. it's giving resilience π«Ά--encoding ENCODING,-e ENCODINGβ the encoding to read/write files in (default: utf8) π-f FUNC,--func FUNCβ a function to use to process lines. this one is required btw, no func no party π-m MODULE,--module MODULEβ modules to import in the function context. so your func actually has stuff to work with π¦
π§ examples:
Strip HTML-like symbols from a subtitle π
$ srt process -m re -f 'lambda sub: re.sub("<[^<]+?>", "", sub)'
look at that lambda go, ate and left no crumbs π
and that's the whole page bestie!! this was srt-process version 3.5.3, dated June 2023 β periodt, go process some subtitles π
π¦ where this page comes from
- debian trixie: python3-srt 3.5.3-1 Β· MIT
- ubuntu noble: python3-srt 3.5.3-1 Β· MIT
- ubuntu questing: python3-srt 3.5.3-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms