@commands.command()
async def play(self, ctx, url):
ctx.voice_client.stop()
FFMPEG_OPTIONS = {'before_options': 'reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
YDL_OPTIONS = {'format': 'bestaudio'}
vc = ctx.voice_client
with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:
info = ydl.extract_info(url, download=False)
url2 = info['formats'][0]['url']
source = await discord.FFmpegOpusAudio.from_probe(url2, **FFMPEG_OPTIONS)
vc.play(source)
This is the code I am using to stream youtube into a discord voice channel. I use VSCode on Mac. I downloaded FFmpeg using homebrew. I keep running into the issue "FFmpeg was not found" even if the FFmpeg folder is in the same directory as my discord.py script. Is there something more I have to do? Also, I don't seem to have an FFmpeg executable. Only .pyc and .py files.