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
3
.gitignore
vendored
3
.gitignore
vendored
@ -125,4 +125,5 @@ info.py
|
|||||||
.idea/
|
.idea/
|
||||||
cookies.txt
|
cookies.txt
|
||||||
selenium_test.py
|
selenium_test.py
|
||||||
selenium_data/
|
selenium_data/
|
||||||
|
config.dev.toml
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from webvtt import WebVTT
|
from webvtt import WebVTT
|
||||||
import html, os
|
import html
|
||||||
|
import os
|
||||||
from pysrt.srtitem import SubRipItem
|
from pysrt.srtitem import SubRipItem
|
||||||
from pysrt.srttime import SubRipTime
|
from pysrt.srttime import SubRipTime
|
||||||
|
|
||||||
@ -8,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, "w")
|
srt = open(srt_filepath, mode="w", errors="ignore")
|
||||||
|
|
||||||
for caption in WebVTT().read(vtt_filepath):
|
for caption in WebVTT().read(vtt_filepath):
|
||||||
index += 1
|
index += 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user