fix youtube error in play cmd

This commit is contained in:
Milka64 2020-09-08 11:02:42 +02:00
parent ef4ebf1c35
commit 33be6d59f4

View file

@ -318,7 +318,9 @@ class Mybot(commands.Cog):
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
info_dict = ydl.extract_info(url, download=False)
out_file = ydl.prepare_filename(info_dict).replace(".webm", ".mp3")
out_file = ydl.prepare_filename(info_dict)
extension = out_file.split('.')[-1]
out_file = out_file.replace(extension, 'mp3')
self.sounds.append((out_file, ctx))
@commands.command()