diff --git a/.gitignore b/.gitignore index 4376719..c48aeea 100644 --- a/.gitignore +++ b/.gitignore @@ -125,4 +125,5 @@ info.py .idea/ cookies.txt selenium_test.py -selenium_data/ \ No newline at end of file +selenium_data/ +config.dev.toml diff --git a/vtt_to_srt.py b/vtt_to_srt.py index 1e2cc28..d262b70 100644 --- a/vtt_to_srt.py +++ b/vtt_to_srt.py @@ -1,5 +1,6 @@ from webvtt import WebVTT -import html, os +import html +import os from pysrt.srtitem import SubRipItem from pysrt.srttime import SubRipTime @@ -8,7 +9,7 @@ def convert(directory, filename): index = 0 vtt_filepath = os.path.join(directory, filename + ".vtt") srt_filepath = os.path.join(directory, filename + ".srt") - srt = open(srt_filepath, "w") + srt = open(srt_filepath, mode="w", errors="ignore") for caption in WebVTT().read(vtt_filepath): index += 1