mirror of
https://github.com/Nezumi-2711/auto-subtitle.git
synced 2026-09-22 13:38:41 +00:00
time format fixes in generated .srt files
This commit is contained in:
committed by
Miguel Piedrafita
parent
6462cd4d56
commit
eeed02cbb3
@@ -26,8 +26,8 @@ def format_timestamp(seconds: float, always_include_hours: bool = False):
|
||||
seconds = milliseconds // 1_000
|
||||
milliseconds -= seconds * 1_000
|
||||
|
||||
hours_marker = f"{hours}:" if always_include_hours or hours > 0 else ""
|
||||
return f"{hours_marker}{minutes:02d}:{seconds:02d}.{milliseconds:03d}"
|
||||
hours_marker = f"{hours:02d}:" if always_include_hours or hours > 0 else ""
|
||||
return f"{hours_marker}{minutes:02d}:{seconds:02d},{milliseconds:03d}"
|
||||
|
||||
|
||||
def write_srt(transcript: Iterator[dict], file: TextIO):
|
||||
|
||||
Reference in New Issue
Block a user