Added support for yt-dlp 'temp' path

- Added support for yt-dlp 	emp path
- Formatted with Black
- Updated README to reflect new TEMP_DIR setting; linted
- Modified Dockerfile to strip carriage return characters from docker-entrypoint.sh script to fix building the image on Windows
- Added example docker-compose.yml config
This commit is contained in:
breakid 2023-05-09 16:05:38 -04:00
parent 17d668a2dd
commit ccff77647c
6 changed files with 220 additions and 113 deletions

View file

@ -17,6 +17,7 @@ class Config:
_DEFAULTS = {
'DOWNLOAD_DIR': '.',
'AUDIO_DOWNLOAD_DIR': '%%DOWNLOAD_DIR',
'TEMP_DIR': '%%DOWNLOAD_DIR',
'DOWNLOAD_DIRS_INDEXABLE': 'false',
'CUSTOM_DIRS': 'true',
'CREATE_CUSTOM_DIRS': 'true',
@ -138,13 +139,13 @@ def get_custom_dirs():
dirs = list(filter(None, map(convert, path.glob('**'))))
return dirs
download_dir = recursive_dirs(config.DOWNLOAD_DIR)
audio_download_dir = download_dir
if config.DOWNLOAD_DIR != config.AUDIO_DOWNLOAD_DIR:
audio_download_dir = recursive_dirs(config.AUDIO_DOWNLOAD_DIR)
return {
"download_dir": download_dir,
"audio_download_dir": audio_download_dir
@ -192,4 +193,5 @@ app.on_response_prepare.append(on_prepare)
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
log.info(f"Listening on {config.HOST}:{config.PORT}")
web.run_app(app, host=config.HOST, port=config.PORT, reuse_port=True)