- Notifications
You must be signed in to change notification settings - Fork45
A Python library for editing subtitle files
License
NotificationsYou must be signed in to change notification settings
tkarabela/pysubs2
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
pysubs2 is a Python library for editing subtitle files.It’s based onSubStation Alpha, the native format ofAegisub; it also supportsSubRip (SRT),MicroDVD,MPL2,TMP,WebVTT,TTML andSAMI formats andOpenAI Whisper captions.
There is a small CLI tool for batch conversion and retiming.
pip install pysubs2pysubs2 --shift 0.3s*.srtpysubs2 --to srt*.ass
importpysubs2subs=pysubs2.load("my_subtitles.ass",encoding="utf-8")subs.shift(s=2.5)forlineinsubs:line.text="{\\be1}"+line.textsubs.save("my_subtitles_edited.ass")
To learn more, pleasesee the documentation.If you'd like to contribute, seeCONTRIBUTING.md.
pysubs2 is licensed under the MIT license (seeLICENSE.txt).
About
A Python library for editing subtitle files