From 66aad0dc50b3ab8ef0e181bbf01cdc313c0d4619 Mon Sep 17 00:00:00 2001 From: Puyodead1 <23562356riley@gmail.com> Date: Fri, 28 May 2021 15:28:03 -0400 Subject: [PATCH] Fix: 1080p not being downloaded when selected --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.py b/main.py index aaafafd..9a05eba 100644 --- a/main.py +++ b/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(len(lecture_audio_sources), len(lecture_video_sources)) else: + print("> Lecture doesn't have DRM, attempting to download...") sources = lecture.get("sources") + sources = sorted(sources, + key=lambda x: int(x.get("height")), + reverse=True) if sources: lecture_working_dir = os.path.join(working_dir, str(lecture.get("asset_id"))) @@ -1077,6 +1081,8 @@ def process_lecture(lecture, lecture_path, lecture_dir, quality, access_token): sources, key=lambda x: abs(int(x.get("height")) - quality)) try: + print("====== Selected quality: ", source.get("type"), + source.get("height")) url = source.get("download_url") source_type = source.get("type") if source_type == "hls":