Ошибка ffmpeg Install ffmpeg or avconv to fix this automatically
Я делал музыкального бота, тут такая ошибка
перекидывание файлов ffmpeg в папку skripts не помогает
Помогите, что делать?
ошибка где то?
Ошибка
WARNING: _5WUAahfUXU: writing DASH m4a. Only some players support this container. Install ffmpeg or avconv to fix this automatically.
помогите пожалуйста
КОД
async def play(ctx, arg):
song_there = os.path.isfile('song.mp3')
rs=requests.get('https://yandex.ru/search/?clid=2367648-307&text=youtubemusic'+arg)
if rs.status_code==200:
url=get_url_music(rs.text)
try:
if song_there:
os.remove('song.mp3')
print('[log] Старый файл удалён')
except PermissionError:
print('[log] Не удалось удалить файл')
await ctx.send('Пожалуйста ожидайте')
voice = get(client.voice_clients, guild = ctx.guild)
ydl_opts = {
'format' : 'bestaudio/best',
'postprocessors' : [{
'key' : 'FFmpegExtractAudio',
'preferredcodec' : 'mp3',
'preferredquality' : '192'
}],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
print('[log] Загружаю музыку...')
ydl.download([url])
for file in os.listdir('./'):
if file.endswith('.mp3'):
name=file
print('[log] Переименнованный файл: {file}')
os.rename(file, 'song.mp3')
voice.play(discord.FFmpegPCMAudio('song.mp3'), after = lambda e: print(f'[log] {name}, музыка закончила своё проигрывание'))
voice.source = discord.PCMVolumeTransformer(voice.source)
voice.source.volume = 0.07
name_song = name.rsplit('-', 2)
await ctx.send(f'Играет трек: {name_song[0]}')
@client.command(pass_context=True)
async def pause(ctx):
voice.pause()
@client.command(pass_context=True)
async def resume(ctx):
voice.resume()
@client.command(pass_context=True)
async def stop(ctx):
voice.stop()
@client.command(pass_comtext=True)
async def music(ctx):
emb=discord.Embed(title = 'Music', colour = discord.Color.dark_gold())
emb.add_field(name = '!play + str', value='запуск трека, название трека одним словом')
emb.add_field(name = '!pause', value='поставить трек на паузу')
emb.add_field(name = '!resume', value='запустить трек вновь')
emb.add_field(name = '!stop', value='остановить трек и очистить поток')
await ctx.send(embed=emb)
def get_url_music(html):
soup = BeautifulSoup(html, 'html.parser')
x=0
for item in soup.find_all('a', class_='link link_theme_outer path__item i-bem'):
x+=1
link = item['href']
if x==2:
any=link
print(any)
return any```