aboutsummaryrefslogtreecommitdiff
path: root/app/ytdl.py
diff options
context:
space:
mode:
authorAlex <alexta69@gmail.com>2023-03-05 11:43:00 +0200
committerGitHub <noreply@github.com>2023-03-05 11:43:00 +0200
commitf1851bf4aa3b176139183d70841dc7986c02d796 (patch)
treeaf0b76527e8430283ccabf22db1862edd13801ac /app/ytdl.py
parentupgraded yt-dlp (diff)
parentDefine the audio formats tuple in python backend (diff)
downloadmetube-f1851bf4aa3b176139183d70841dc7986c02d796.tar.gz
metube-f1851bf4aa3b176139183d70841dc7986c02d796.tar.bz2
metube-f1851bf4aa3b176139183d70841dc7986c02d796.zip
Merge pull request #230 from georgekav2/feature/add_vorbis_opus_wav
Add support for opus and wav
Diffstat (limited to 'app/ytdl.py')
-rw-r--r--app/ytdl.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/ytdl.py b/app/ytdl.py
index 3c21e0e..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")) 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.'}
bgstack15