diff options
author | Alex Shnitman <alexta69@gmail.com> | 2021-08-27 12:14:37 +0300 |
---|---|---|
committer | Alex Shnitman <alexta69@gmail.com> | 2021-08-27 12:19:53 +0300 |
commit | 058e03876f5519c25443258f53f6e374459622ce (patch) | |
tree | 9f5ff5bbf770565678932f2dbaf43a2f677985fe /app | |
parent | prefer mp4 format (diff) | |
download | metube-058e03876f5519c25443258f53f6e374459622ce.tar.gz metube-058e03876f5519c25443258f53f6e374459622ce.tar.bz2 metube-058e03876f5519c25443258f53f6e374459622ce.zip |
allow all video formats, and merge into mp4
Diffstat (limited to 'app')
-rw-r--r-- | app/ytdl.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/ytdl.py b/app/ytdl.py index 53dacd6..ef4ada0 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -36,10 +36,10 @@ class Download: self.download_dir = download_dir
self.output_template = output_template
if quality == 'best':
- self.format = 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'
+ self.format = 'bestvideo+bestaudio/best[ext=mp4]/best'
elif quality in ('1440p', '1080p', '720p', '480p'):
res = quality[:-1]
- self.format = f'bestvideo[height<={res}][ext=mp4]+bestaudio[ext=m4a]/best[height<={res}][ext=mp4]/best[height<={res}]'
+ self.format = f'bestvideo[height<={res}]+bestaudio/best[height<={res}][ext=mp4]/best[height<={res}]'
elif quality == 'audio':
self.format = 'bestaudio'
elif quality.startswith('custom:'):
@@ -73,6 +73,7 @@ class Download: #'skip_download': True,
'outtmpl': os.path.join(self.download_dir, self.output_template),
'format': self.format,
+ 'merge_output_format': 'mp4',
'cachedir': False,
'socket_timeout': 30,
'progress_hooks': [put_status],
|