From 1020540cab4b7e519e903a5b94a3e62aae61441a Mon Sep 17 00:00:00 2001 From: Thomas Heil Date: Fri, 29 Dec 2023 11:01:04 +0100 Subject: [PATCH] Enhancement: If the given resolution e.g 720 is not available, lets take the max available one and leave the description etc. as it is. Signed-off-by: Thomas Heil --- bin/download_what.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/download_what.py b/bin/download_what.py index f6fcf47..a8d7e96 100644 --- a/bin/download_what.py +++ b/bin/download_what.py @@ -246,7 +246,11 @@ def download_what(ds, api_course, course_id, fmt, transcript_lang, what, enable_ skip=True ok=True if not skip: - url=stream_locs[fmt].url + if fmt in stream_locs: + url=stream_locs[fmt].url + else: + url=stream_locs[max(stream_locs)].url + status_code = downloadFile(url,media_output_filename) if status_code != 200: retry_count += 1