Making a Music Discord Bot

Hey there. I am making a Music Discord Bot using Repli.it I have made the bot join my voice channel and download the music but it does not plays it. It gives my the following error. If anyone can help me, then please do.

[youtube] ALZHF5UqnU4: Downloading webpage
[download] Marshmello - Alone (Official Music Video)-ALZHF5UqnU4.webm has already been downloaded
[download] 100% of 3.13MiB
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
Ignoring exception in command play:
Traceback (most recent call last):
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2115, in post_process
    files_to_delete, info = pp.run(info)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 275, in run
    filecodec = self.get_audio_codec(path)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 166, in get_audio_codec
    raise PostProcessingError('ffprobe/avprobe and ffmpeg/avconv not found. Please install one.')
youtube_dl.utils.PostProcessingError: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 304, in play
    ydl.download([url])
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2068, in download
    res = self.extract_info(
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 808, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 847, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 881, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 1692, in process_video_result
    self.process_info(new_info)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2050, in process_info
    self.post_process(filename, info_dict)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2117, in post_process
    self.report_error(e.msg)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 628, in report_error
    self.trouble(error_message, tb)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 598, in trouble
    raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.

Hi

This Stack Overflow thread might help - there are quite a few suggestions for fixing these errors across Mac/Windows/Linux.

you need install ffmpeg .

on on ubuntu and debian

sudo apt-get install ffmpeg

on MacOs

brew install ffmpeg

I think it is for javascript and my bot is made with python

I am making it using repl.it, which one should I use?

You’re right - I do apologise.

This SO thread is specific to Python and might be more helpful.

Otherwise, just try a Google search for the error message - you might find something that’s more relevant for your environment.

[ Repl.it and FFmpeg](python - Repl.it and FFmpeg - Stack Overflow)
It have a example.

I tried the example and I got this error. Please help me.

[youtube] ALZHF5UqnU4: Downloading webpage
[youtube] ALZHF5UqnU4: Downloading player dfd2e197
[download] Destination: Marshmello - Alone (Official Music Video)-ALZHF5UqnU4.webm
[download] 100% of 3.13MiB in 00:43
[ffmpeg] Destination: Marshmello - Alone (Official Music Video)-ALZHF5UqnU4.mp3
Deleting original file Marshmello - Alone (Official Music Video)-ALZHF5UqnU4.webm (pass -k to keep)
Ignoring exception in command play:
Traceback (most recent call last):
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 308, in play
    voice.play(discord.FFmpegPCMAudio("song.mp3"))
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/voice_client.py", line 564, in play
    self.encoder = opus.Encoder()
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/opus.py", line 286, in __init__
    _OpusStruct.get_opus_version()
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/opus.py", line 280, in get_opus_version
    raise OpusNotLoaded()
discord.opus.OpusNotLoaded

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/runner/Discord-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OpusNotLoaded:

so solved

watch the reply Manav Mehta .

the isssus will get you more info