Skip to content

Commit

Permalink
subrip.py updated, to add "end of this subtitle" to the last subtitle…
Browse files Browse the repository at this point in the history
… too (#218)

Changed the "in-between" newline logic, to force the last line of every subtitle to be a blank line. See #217
  • Loading branch information
gnanet authored Mar 10, 2024
1 parent 4fa64c4 commit 92db8f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aeidon/files/subrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def write_to_file(self, subtitles, doc, f):
Raise :exc:`UnicodeError` if encoding fails.
"""
for i, subtitle in enumerate(subtitles):
if i > 0: f.write("\n")
f.write("{:d}\n".format(i + 1))
start = subtitle.start_time.replace(".", ",")
end = subtitle.end_time.replace(".", ",")
Expand All @@ -103,3 +102,4 @@ def write_to_file(self, subtitles, doc, f):
f.write(" X1:{:03d} X2:{:03d}".format(x1, x2))
f.write( " Y1:{:03d} Y2:{:03d}".format(y1, y2))
f.write("\n{}\n".format(subtitle.get_text(doc)))
f.write("\n")

0 comments on commit 92db8f1

Please sign in to comment.