![]() Note that there's no error management, you'll have to do it yourself.It will reconnect the bot to the source so it's still able to stream the video, when this happens, you'll have a strange message in your terminal that you don't need to be worried of. To solve this problem, you have to use that FFMPEG_OPTS variable. ![]() However, streaming audio causes a known issue, explained here.Can generate videos and images of the results via ffmpeg-python and pillow. To know what the video variable contains, you can print it. I found out that ytdl-core works fine, but as someone mentioned on the discord, Discord uses opus, which isn't supported (which is why it wouldn't connect to a VC. python discord-bot youtube-dl pillow discord-py ffmpeg-python Updated Jan 3, 2022.ay(FFmpegPCMAudio(source, **FFMPEG_OPTS), after=lambda e: print('done', e)) #Get videos from links or from youtube search Install requests ( pip install requests).Installing youtube_dl ( pip install youtube-dl) if you don't have it.You're already using youtube_dl (judging by your ydl_opts var). Vc.play(discord.FFmpegPCMAudio('music.mp3'), after=lambda e: print('done', e)) You can vote up the ones you like or vote down the ones you dont like, and go to the original. Os.system("ffmpeg -i music.mp4 -map 0:a:0 -b:a 96k music.mp3") The following are 12 code examples of discord.FFmpegPCMAudio(). Youtube = pytube.YouTube(str(song).strip("(,)'")) Thanks for any input! def play(ctx, *song): ![]() I don't care much about smaller code optimizations as this is just a small bot for a few friends and me. How would I go about streaming the audio directly into the VC? I'm open to use youtube_dl in place of pytube3. At the moment, the command downloads the full song, converts it, and then outputs it into a VC, but this process is heavily slow. install-pkg ffmpeg 8 months ago 1 ZeroDiscord You may simply install the static binaries for ffmpeg using npm install ffmpeg-static -save 9 months ago 1 ArchieMaclean Currently, I think doesn't support this. ![]() I have setup a music command that downloads a song from YouTube and outputs it into a VC. I have a discord.py bot setup in a small server of mine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |