Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

riobard/srt.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

srt.py

srt.py is a simple Python script to manipulate soft subtitles in .srt format. Most of the basic stuff of parsing the .srt format is done, so it will be relatively easy to implement high-level manipulation commands. Currently only split command is implemented.

For more information about the .srt format, see here and here.

Usage

python srt.py split subtitle.srt 42:30 45:10

This will split subtitle.srt into three parts, named subtitle.srt.000, subtitle.srt.001, subtitle.srt.002, with the subtitle.srt.000 being 42 minutes and 30 seconds in length, subtitle.srt.001 being 45 minutes and 10 seconds in length, and subtitle.srt.002 the rest of the original file.

python srt.py shift subtitle.srt -,500 > new.subtitle.srt

This will move the subtitle 500 milliseconds towards the beginning. Output is redirected to the file named new.subtitle.srt. Use this to sync subtitle with video.

About

A Python script to manipulate .srt subtitles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages