0

I making discord bot and i am trying to move from youtube_dl to yt_dlp to get +18 videos from youtube, I am getting error Output file #0 does not contain any stream.

self.YTDL_OPTIONS = {'format': 'bestaudio', 'nonplaylist': 'True', 'youtube_include_dash_manifest': False}

self.FFMPEG_OPTIONS = {
    'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
    'options': '-vn'
}
with YoutubeDL(self.YTDL_OPTIONS) as ydl:
    try:
        info = ydl.extract_info(url, download=False)
    except:
        return False
return {
    'link': 'https://www.youtube.com/watch?v=' + url,
    'thumbnail': 'https://i.ytimg.com/vi/' + url + '/hqdefault.jpg?sqp=-oaymwEcCOADEI4CSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD5uL4xKN-IUfez6KIW_j5y70mlig',
    'source': info['formats'][0]['url'],
    'title': info['title']
}
self.vc[id].play(discord.FFmpegPCMAudio(
    song['source'], **self.FFMPEG_OPTIONS), after=lambda e: self.play_next(interaction))

This config works with youtube_dl, but not with yt_dlp. Any ideas what i should change?

matiz22
  • 1
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 26 '22 at 08:16

0 Answers0