Intelligent SDH/HI removal tool removal tool for SRT subtitles.
- PyPI:
pip install pysdhstrip
- From source:
pdm install
import pysdhstrip
with open("input.srt", encoding="utf-8") as fd:
subtitles = fd.read()
stripped = pysdhstrip.strip(subtitles)
with open("output.srt", "w", encoding="utf-8") as fd:
fd.write(stripped)
Needs to be installed via pip install "pysdhstrip[cli]"
or pdm install --group cli
.
$ pysdhstrip input.srt -o output.srt
$ pysdhstrip input.srt # Output to stdout
$ pysdhstrip -w input.srt # Overwrite input file