aboutsummaryrefslogtreecommitdiff
path: root/app/main.py
diff options
context:
space:
mode:
authorJames Woglom <j@wogloms.net>2022-08-29 18:25:29 -0400
committerJames Woglom <j@wogloms.net>2022-08-29 18:25:29 -0400
commite28458a74f28fa9eeed374cc851497deaf90b88d (patch)
tree0f670e5ebd1df3d746b4420b88110d65618c09f8 /app/main.py
parentupgraded yt-dlp (diff)
downloadmetube-e28458a74f28fa9eeed374cc851497deaf90b88d.tar.gz
metube-e28458a74f28fa9eeed374cc851497deaf90b88d.tar.bz2
metube-e28458a74f28fa9eeed374cc851497deaf90b88d.zip
Backend: support "folder" POST param and add config options
Diffstat (limited to 'app/main.py')
-rw-r--r--app/main.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/main.py b/app/main.py
index 9fbdf19..ecc5040 100644
--- a/app/main.py
+++ b/app/main.py
@@ -16,11 +16,13 @@ class Config:
_DEFAULTS = {
'DOWNLOAD_DIR': '.',
'AUDIO_DOWNLOAD_DIR': '%%DOWNLOAD_DIR',
+ 'CUSTOM_DIR': 'true',
+ 'AUTO_CREATE_CUSTOM_DIR': 'false',
'STATE_DIR': '.',
'URL_PREFIX': '',
'OUTPUT_TEMPLATE': '%(title)s.%(ext)s',
'OUTPUT_TEMPLATE_CHAPTER': '%(title)s - %(section_number)s %(section_title)s.%(ext)s',
- 'YTDL_OPTIONS': '{}',
+ 'YTDL_OPTIONS': '{}'
}
def __init__(self):
@@ -80,7 +82,8 @@ async def add(request):
if not url or not quality:
raise web.HTTPBadRequest()
format = post.get('format')
- status = await dqueue.add(url, quality, format)
+ folder = post.get('folder')
+ status = await dqueue.add(url, quality, format, folder)
return web.Response(text=serializer.encode(status))
@routes.post(config.URL_PREFIX + 'delete')
bgstack15