From b93f7a1ae50bf85fba121eb63036ac0a239f7856 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Tue, 5 Nov 2024 04:40:59 +0100 Subject: [PATCH] Limit download video resolution to max. full HD. --- ytplom.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ytplom.py b/ytplom.py index 1dbd147..370f504 100755 --- a/ytplom.py +++ b/ytplom.py @@ -103,7 +103,10 @@ def download_thread(): except IndexError: continue url = f'{YOUTUBE_URL_PREFIX}{video_id}' - params = {'paths': {'home': PATH_DIR_DOWNLOADS, 'temp': NAME_DIR_TEMP}} + fmt = 'bestvideo[height<=1080][width<=1920]+bestaudio'\ + '/best[height<=1080][width<=1920]' + params = {'paths': {'home': PATH_DIR_DOWNLOADS, 'temp': NAME_DIR_TEMP}, + 'format': fmt} with YoutubeDL(params) as ydl: ydl.download([url]) -- 2.30.2