From 37856a75753705dca40c933c5ef7bcffdd7cae3e Mon Sep 17 00:00:00 2001 From: danielmawhirter Date: Thu, 21 Nov 2024 18:33:47 -0600 Subject: [PATCH] Configure minimum permitted video height with VIDEO_HEIGHT_CUTOFF env var --- README.md | 3 ++- tubesync/tubesync/settings.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f0d259b..b85b2b4a 100644 --- a/README.md +++ b/README.md @@ -368,13 +368,14 @@ useful if you are manually installing TubeSync in some other environment. These | TUBESYNC_DEBUG | Enable debugging | True | | TUBESYNC_WORKERS | Number of background workers, default is 2, max allowed is 8 | 2 | | TUBESYNC_HOSTS | Django's ALLOWED_HOSTS, defaults to `*` | tubesync.example.com,otherhost.com | -| TUBESYNC_RESET_DOWNLOAD_DIR | Toggle resetting `/downloads` permissions, defaults to True | True +| TUBESYNC_RESET_DOWNLOAD_DIR | Toggle resetting `/downloads` permissions, defaults to True | True | | GUNICORN_WORKERS | Number of gunicorn workers to spawn | 3 | | LISTEN_HOST | IP address for gunicorn to listen on | 127.0.0.1 | | LISTEN_PORT | Port number for gunicorn to listen on | 8080 | | HTTP_USER | Sets the username for HTTP basic authentication | some-username | | HTTP_PASS | Sets the password for HTTP basic authentication | some-secure-password | | DATABASE_CONNECTION | Optional external database connection details | mysql://user:pass@host:port/database | +| VIDEO_HEIGHT_CUTOFF | Smallest video height in pixels permitted to download | 240 | # Manual, non-containerised, installation diff --git a/tubesync/tubesync/settings.py b/tubesync/tubesync/settings.py index bbb93422..d67d577a 100644 --- a/tubesync/tubesync/settings.py +++ b/tubesync/tubesync/settings.py @@ -150,8 +150,8 @@ MEDIA_THUMBNAIL_WIDTH = 430 # Width in pixels to resize thumbnai MEDIA_THUMBNAIL_HEIGHT = 240 # Height in pixels to resize thumbnails to -VIDEO_HEIGHT_CUTOFF = 240 # Smallest resolution in pixels permitted to download -VIDEO_HEIGHT_IS_HD = 500 # Height in pixels to count as 'HD' +VIDEO_HEIGHT_CUTOFF = int(os.getenv("VIDEO_HEIGHT_CUTOFF", "240")) # Smallest resolution in pixels permitted to download +VIDEO_HEIGHT_IS_HD = 500 # Height in pixels to count as 'HD' YOUTUBE_DL_CACHEDIR = None