home · contact · privacy
Limit download video resolution to max. full HD.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 5 Nov 2024 03:40:59 +0000 (04:40 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 5 Nov 2024 03:40:59 +0000 (04:40 +0100)
ytplom.py

index 1dbd147ab6fdfefc8eb8379eda5cd3d8e1716dba..370f504483ede58e3eec7f65f5b547e3b82c20cb 100755 (executable)
--- 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])