mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-05-03 21:04:26 +02:00
Merge branch 'feat-improved-asset-downloads'
This commit is contained in:
commit
b8b79b2293
14
main.py
14
main.py
@ -398,7 +398,6 @@ def process_lecture(lecture, lecture_index, lecture_path, lecture_dir):
|
|||||||
"> Couldn't find dash url for lecture '%s', skipping...",
|
"> Couldn't find dash url for lecture '%s', skipping...",
|
||||||
lecture_title)
|
lecture_title)
|
||||||
return
|
return
|
||||||
base_url = mpd_url.split("index.mpd")[0]
|
|
||||||
media_info = manifest_parser(mpd_url)
|
media_info = manifest_parser(mpd_url)
|
||||||
handle_irregular_segments(media_info, lecture_title,
|
handle_irregular_segments(media_info, lecture_title,
|
||||||
lecture_working_dir, lecture_path)
|
lecture_working_dir, lecture_path)
|
||||||
@ -428,6 +427,19 @@ def process_lecture(lecture, lecture_index, lecture_path, lecture_dir):
|
|||||||
f"> Error downloading lecture asset: {e}. Skipping"
|
f"> Error downloading lecture asset: {e}. Skipping"
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
elif asset["asset_type"] == "Article":
|
||||||
|
assets.append(asset)
|
||||||
|
asset_path = f"%s\\%s.html" % (lecture_dir,
|
||||||
|
sanitize(lecture_title))
|
||||||
|
with open(asset_path, 'w') as f:
|
||||||
|
f.write(asset["body"])
|
||||||
|
elif asset["asset_type"] == "ExternalLink":
|
||||||
|
assets.append(asset)
|
||||||
|
asset_path = f"%s\\%s. External URLs.txt" % (lecture_dir,
|
||||||
|
lecture_index)
|
||||||
|
with open(asset_path, 'a') as f:
|
||||||
|
f.write(f"%s : %s\n" %
|
||||||
|
(asset["title"], asset["external_url"]))
|
||||||
print("> Found %s assets for lecture '%s'" %
|
print("> Found %s assets for lecture '%s'" %
|
||||||
(len(assets), lecture_title))
|
(len(assets), lecture_title))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user