Attempt to fix encoding problems with caption conversion (#92, #98, #97)

This commit is contained in:
Puyodead1 2023-02-02 17:54:46 -05:00
parent d8b5d3ca0e
commit f321791819
No known key found for this signature in database
GPG Key ID: BA5F91AAEF68E5CE

View File

@ -9,7 +9,7 @@ def convert(directory, filename):
index = 0 index = 0
vtt_filepath = os.path.join(directory, filename + ".vtt") vtt_filepath = os.path.join(directory, filename + ".vtt")
srt_filepath = os.path.join(directory, filename + ".srt") srt_filepath = os.path.join(directory, filename + ".srt")
srt = open(srt_filepath, mode="w", errors="ignore") srt = open(srt_filepath, mode='w', encoding='utf8', errors='ignore')
for caption in WebVTT().read(vtt_filepath): for caption in WebVTT().read(vtt_filepath):
index += 1 index += 1