Skip to content

Commit

Permalink
adds missing function
Browse files Browse the repository at this point in the history
  • Loading branch information
zackees committed May 10, 2023
1 parent 3a08ea0 commit ecb9955
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/video_subtitles/convert_to_webvtt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Conversion to test to webvtt format.
"""


import webvtt # pylint: disable=import-error


def convert_to_webvtt(srt_file: str, out_webvtt_file: str) -> None:
"""Convert to webvtt format."""
assert srt_file.endswith(".srt")
assert out_webvtt_file.endswith(".vtt")
webvtt.from_srt(srt_file).save(out_webvtt_file)

0 comments on commit ecb9955

Please sign in to comment.