directory mode on settings

This commit is contained in:
tcely 2024-12-09 14:06:35 -05:00 committed by GitHub
parent 0fafca037c
commit 279a01f9bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,6 +112,15 @@ DOWNLOAD_VIDEO_DIR = 'video'
DOWNLOAD_AUDIO_DIR = 'audio'
SASS_PROCESSOR_ROOT = STATIC_ROOT
directory_mode = os.getenv("TUBESYNC_DIRECTORY_MODE", "default")
if directory_mode == 'flat':
DOWNLOAD_VIDEO_DIR = '.'
DOWNLOAD_AUDIO_DIR = '.'
elif directory_mode.startswith("custom:"):
custom_value = directory_mode.split(":")[1]
if str(',') in custom_value:
DOWNLOAD_AUDIO_DIR, DOWNLOAD_VIDEO_DIR = custom_value.split(',')
ROBOTS = '''
User-agent: *