From ea37e8a3978d183b8f54f63a043cc4f032c8413a Mon Sep 17 00:00:00 2001 From: Puyodead1 <14828766+Puyodead1@users.noreply.github.com> Date: Wed, 12 Jan 2022 19:55:30 -0500 Subject: [PATCH] bug fix --- .gitignore | 3 ++- vtt_to_srt.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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