byroot / pysrt

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

SubRipTime.to_time() does not support times over 24 hours #95

Open gboyd068 opened 10 months ago

gboyd068 commented 10 months ago

The .srt format stores times in hours / minutes / seconds / milliseconds, where the number of hours can be greater than 23. When converting the following subtitle to a time, ValueError: hour must be in 0..23 is raised as datetime.time stores times in days / hours /minutes etc

23939
32:54:04,120 --> 32:54:09,120
 The end of the first book