correction command play

This commit is contained in:
BFlow 2020-04-29 17:46:31 +02:00
parent f238171ca1
commit a13887de58

View file

@ -261,7 +261,7 @@ class Mybot(commands.Cog):
await ctx.channel.send("Tu peux reparler %s!" % member.mention) await ctx.channel.send("Tu peux reparler %s!" % member.mention)
@commands.command(help="Jouer un song a partir d'une video") @commands.command(help="Jouer un song a partir d'une video")
async def play(self, ctx, lien): async def play(self, ctx, url):
ydl_opts = {'format': 'bestaudio/mp3', 'outtmpl': '/tmp/discord_%(title)s-%(id)s.%(ext)s', ydl_opts = {'format': 'bestaudio/mp3', 'outtmpl': '/tmp/discord_%(title)s-%(id)s.%(ext)s',
'postprocessors': [{ 'postprocessors': [{
'key': 'FFmpegExtractAudio', 'key': 'FFmpegExtractAudio',
@ -270,7 +270,7 @@ class Mybot(commands.Cog):
}], }],
} }
with youtube_dl.YoutubeDL(ydl_opts) as ydl: with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([lien]) 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) out_file = ydl.prepare_filename(info_dict)
self.sounds.append(out_file) self.sounds.append(out_file)