byroot / pysrt

Python parser for SubRip (srt) files
GNU General Public License v3.0
446 stars 67 forks source link

how to create a new line? #55

Closed 1c7 closed 10 years ago

1c7 commented 10 years ago

maybe you can add some method like:

subs.addAfter(LineNumber, StartTime, EndTime, SubtitleContent) subs.addBefore(LineNumber, StartTime, EndTime, SubtitleContent)

subs.addAfterLastLine(StartTime, EndTime, SubtitleContent) subs.addAfterLastLine(duringtime, SubtitleContent)

byroot commented 10 years ago

Well, srt files are sortable. So if you want to add a new subtitle you can just append it with the good timestamps and then sort the file before writing it.

Adding a method to insert in order might be a good idea though, I'll think about it.

1c7 commented 10 years ago

THANK YOU