This commit is contained in:
Puyodead1 2022-01-12 19:55:30 -05:00
parent 884be3b68a
commit ea37e8a397
2 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@ -126,3 +126,4 @@ info.py
cookies.txt
selenium_test.py
selenium_data/
config.dev.toml

View File

@ -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