postprocess to 256 kbps mp3

This commit is contained in:
Tomáš Mládek 2019-04-18 16:37:27 +02:00 committed by Tomáš Mládek
parent b37e4be8b3
commit eb0e85faa7

View file

@ -79,10 +79,11 @@ class DelojzaBot:
}
if extract:
ydl_opts['format'] = 'bestaudio'
# ydl_opts['postprocessors'] = [{
# 'key': 'FFmpegExtractAudio',
# 'preferredcodec': 'wav'
# }]
ydl_opts['postprocessors'] = [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '256'
}]
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(urls)
out_dir = os.path.join(self.out_dir, subdir)