mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-05-01 11:54:25 +02:00
Fix: 1080p not being downloaded when selected
This commit is contained in:
parent
1fa5bdba90
commit
66aad0dc50
6
main.py
6
main.py
@ -1064,7 +1064,11 @@ def process_lecture(lecture, lecture_path, lecture_dir, quality, access_token):
|
|||||||
print(f"> Lecture '%s' is missing media links" % lecture_title)
|
print(f"> Lecture '%s' is missing media links" % lecture_title)
|
||||||
print(len(lecture_audio_sources), len(lecture_video_sources))
|
print(len(lecture_audio_sources), len(lecture_video_sources))
|
||||||
else:
|
else:
|
||||||
|
print("> Lecture doesn't have DRM, attempting to download...")
|
||||||
sources = lecture.get("sources")
|
sources = lecture.get("sources")
|
||||||
|
sources = sorted(sources,
|
||||||
|
key=lambda x: int(x.get("height")),
|
||||||
|
reverse=True)
|
||||||
if sources:
|
if sources:
|
||||||
lecture_working_dir = os.path.join(working_dir,
|
lecture_working_dir = os.path.join(working_dir,
|
||||||
str(lecture.get("asset_id")))
|
str(lecture.get("asset_id")))
|
||||||
@ -1077,6 +1081,8 @@ def process_lecture(lecture, lecture_path, lecture_dir, quality, access_token):
|
|||||||
sources,
|
sources,
|
||||||
key=lambda x: abs(int(x.get("height")) - quality))
|
key=lambda x: abs(int(x.get("height")) - quality))
|
||||||
try:
|
try:
|
||||||
|
print("====== Selected quality: ", source.get("type"),
|
||||||
|
source.get("height"))
|
||||||
url = source.get("download_url")
|
url = source.get("download_url")
|
||||||
source_type = source.get("type")
|
source_type = source.get("type")
|
||||||
if source_type == "hls":
|
if source_type == "hls":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user