SRT with blank dialog ends file
Closed this issue · 0 comments
KyleJamesWalker commented
Example:
from pycaption import detect_format, SRTWriter
data = '''1
00:00:00,333 --> 00:00:01,300
2
00:00:01,300 --> 00:00:02,400
DID YOU HAVE A GOOD SUMMER?
3
00:00:02,400 --> 00:00:03,833
I HAD A GREAT SUMMER, ACTUALLY.
'''
reader = detect_format(data)
new_data = SRTWriter().write(reader().read(data))
Crashes:
pycaption.exceptions.CaptionReadNoCaptions: CaptionReadNoCaptions(('empty caption file',))
Removing the extra line, or adding dialog to the blank line works as expected.
Also placing the blank line in the middle of the file will terminate the file early (without an exception)
If this is something you feel should be fixed, let me know and I can look into creating a pull request for this issue.