You are browsing as a guest. Sign up (or log in) to start making projects!

1h 56m 15s logged

Hey guys, today I’m working on fixing the ds bot. First of all I had to review the method of streaming the song.
I was first using yt-dlp for everything, but I noted that putting it on a server was making it not working anymore. I discovered that is because yt blocks certain ips and certain requests, so this was an impossible choice. The solution was spotify preview, which are basically like 20 seconds of a song. That’s perfect for me, since I don’t have to stream the whole song, but instead just a little part.

The approach is this. I created a variable in the env, called DEPLOY_ENV. This specifies if we’re running the bot locally, or on a server or vps.

If the variable is vps, first the bot is gonna try finding the song on spotify. If it’s not present, it’s gonna search for local files, as alternative.

If the variable is local, the first alternative remains spotify, but as a second there’s also yt-dlp, since locally it works fine.

I also adjusted the cards of some commands, as you can see from the screens, along with testing out the bot.

I still have some more work to do, but I think soon the ds bot will be ready.

0
5

Comments 0

No comments yet. Be the first!