diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/main.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/main.py b/app/main.py index 194bba6..dad19e3 100644 --- a/app/main.py +++ b/app/main.py @@ -16,7 +16,7 @@ log = logging.getLogger('main') class Config:
_DEFAULTS = {
'DOWNLOAD_DIR': '.',
- 'AUDIO_DOWNLOAD_DIR': '.',
+ 'AUDIO_DOWNLOAD_DIR': '%%DOWNLOAD_DIR',
'URL_PREFIX': '',
'OUTPUT_TEMPLATE': '%(title)s.%(ext)s',
}
@@ -24,6 +24,9 @@ class Config: def __init__(self):
for k, v in self._DEFAULTS.items():
setattr(self, k, os.environ[k] if k in os.environ else v)
+ for k, v in self.__dict__.items():
+ if v.startswith('%%'):
+ setattr(self, k, getattr(self, v[2:]))
if not self.URL_PREFIX.endswith('/'):
self.URL_PREFIX += '/'
|