diff options
author | georgekav <> | 2023-03-05 10:34:49 +0100 |
---|---|---|
committer | georgekav <> | 2023-03-05 10:34:49 +0100 |
commit | 693629221814f79d6357403c436d96429ed14023 (patch) | |
tree | 85053883d53c5e2eb45a62510c0e8ac59159596e /app/ytdl.py | |
parent | Add support for opus and wav (diff) | |
download | metube-693629221814f79d6357403c436d96429ed14023.tar.gz metube-693629221814f79d6357403c436d96429ed14023.tar.bz2 metube-693629221814f79d6357403c436d96429ed14023.zip |
Define the audio formats tuple in python backend
Diffstat (limited to 'app/ytdl.py')
-rw-r--r-- | app/ytdl.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/ytdl.py b/app/ytdl.py index b72f883..c001a16 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -7,7 +7,7 @@ import asyncio import multiprocessing
import logging
import re
-from dl_formats import get_format, get_opts
+from dl_formats import get_format, get_opts, AUDIO_FORMATS
log = logging.getLogger('ytdl')
@@ -234,7 +234,7 @@ class DownloadQueue: if not self.queue.exists(entry['id']):
dl = DownloadInfo(entry['id'], entry['title'], entry.get('webpage_url') or entry['url'], quality, format, folder)
# Keep consistent with frontend
- base_directory = self.config.DOWNLOAD_DIR if (quality != 'audio' and format not in ("m4a", "mp3", "opus", "wav")) else self.config.AUDIO_DOWNLOAD_DIR
+ base_directory = self.config.DOWNLOAD_DIR if (quality != 'audio' and format not in AUDIO_FORMATS) else self.config.AUDIO_DOWNLOAD_DIR
if folder:
if not self.config.CUSTOM_DIRS:
return {'status': 'error', 'msg': f'A folder for the download was specified but CUSTOM_DIRS is not true in the configuration.'}
|