fix youtube error in play cmd
This commit is contained in:
parent
ef4ebf1c35
commit
33be6d59f4
1 changed files with 3 additions and 1 deletions
|
@ -318,7 +318,9 @@ class Mybot(commands.Cog):
|
||||||
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
||||||
ydl.download([url])
|
ydl.download([url])
|
||||||
info_dict = ydl.extract_info(url, download=False)
|
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))
|
self.sounds.append((out_file, ctx))
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
|
|
Loading…
Reference in a new issue