mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-04-30 00:24:25 +02:00
bug fix
This commit is contained in:
parent
884be3b68a
commit
ea37e8a397
1
.gitignore
vendored
1
.gitignore
vendored
@ -126,3 +126,4 @@ info.py
|
||||
cookies.txt
|
||||
selenium_test.py
|
||||
selenium_data/
|
||||
config.dev.toml
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user