mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-04-30 00:54:25 +02:00
Update main.py
This commit is contained in:
parent
ef9d2a6be3
commit
5d01e56756
2
main.py
2
main.py
@ -1574,7 +1574,7 @@ def parse_new(udemy: Udemy, udemy_object: dict):
|
|||||||
if extension == "html":
|
if extension == "html":
|
||||||
# if the html content is None or an empty string, skip it so we dont save empty html files
|
# if the html content is None or an empty string, skip it so we dont save empty html files
|
||||||
if parsed_lecture.get("html_content") != None and parsed_lecture.get("html_content") != "":
|
if parsed_lecture.get("html_content") != None and parsed_lecture.get("html_content") != "":
|
||||||
html_content = parsed_lecture.get("html_content").encode("ascii", "ignore").decode("utf8")
|
html_content = parsed_lecture.get("html_content").encode("ascii", "ignore").decode("ascii")
|
||||||
lecture_path = os.path.join(chapter_dir, "{}.html".format(sanitize_filename(lecture_title)))
|
lecture_path = os.path.join(chapter_dir, "{}.html".format(sanitize_filename(lecture_title)))
|
||||||
try:
|
try:
|
||||||
with open(lecture_path, encoding="utf8", mode="w") as f:
|
with open(lecture_path, encoding="utf8", mode="w") as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user