eritislami / evobot

🤖 EvoBot is a Discord Music Bot built with TypeScript + Discord.js, includes Docker builds & localization in 20+ languages
MIT License
1.85k stars 2.01k forks source link

EvoBot Project Update #1672

Open eritislami opened 3 months ago

eritislami commented 3 months ago

EvoBot Update: YouTube Issues & Project Status

Hey everyone,

I wanted to give you all a heads up about what's going on with EvoBot. As you might have noticed, we've hit a pretty big snag.

The Problem

YouTube's been cracking down hard on bots like this one. They've put in place some tough measures that are making it nearly impossible for EvoBot (and other Discord music bots) to grab audio from YouTube videos.

Where We're At

I'll be straight with you: EvoBot is kind of in limbo right now. I don't want to say it's dead because I'm hoping we can figure something out, but for now, we're basically on pause.

Why We're Not Using "Easy" Fixes

Now, I know some of you might be thinking, "Can't we just use our own cookies to get around this?" And yeah, that might work. But here's the thing - EvoBot was supposed to be this easy-to-use template. Having everyone mess around with exporting their browser cookies and stuffing them into the code? That's not what I had in mind when I started this project.

What's Next?

Honestly, I'm not sure yet. I'm keeping an eye out for solutions that don't involve everyone jumping through hoops just to get their bot working. Until we find something that fits the bill, EvoBot's going to stay on the bench.

If anyone's got ideas on how we can tackle this without making things super complicated for users, I'm all ears.

Thanks for sticking with EvoBot, and for understanding. I'll keep you posted if anything changes.

EduardoJGilA commented 3 months ago

For now, I think the best thing is to give us the option of using our cookies and thus have a temporary solution, right? It would be the best for now.

SugarD-x commented 3 months ago

I would also like to suggest that development in other areas continue. (The best they can without being able to test things like YouTube videos/music). There are a lot of open pull requests, mainly related to outdated dependencies. Last I used the code, there were also some security concerns caused by said dependencies, (although I'm not sure if that is still the case). Things like this should still be worked on while we search for a solution, as one will eventually come. This is far from the first time something like this has happened, and I doubt it'll be the last either.

rockrevenchy commented 3 months ago

Thx for the update, even know it's not exciting news I appreciate the transparency.

Thx for keeping the bot up that point, hopefully a switch of libraries would be on the table and a decent fix in the future

Else i know it isn't ideal at all but going back to SoundCloud compatibility may be an option too at least until Google settles a bit

dieser-niko commented 3 months ago

What about using Invidious? It has a fairly easy to use API. Here's an example: https://invidious.privacyredirect.com/api/v1/videos/dQw4w9WgXcQ Under adaptiveFormats you can choose a custom format depending on what you prefer. There are a few audio-only options to choose from. Then just use the url as a source and you're done.

Obviously Invidious is also suffering from the bot crackdown, so not every public instance will always work. Sometimes the URL to the audio file is invalid, other times the API can't return anything, and some public instances even have Cloudflare in place, which doesn't want to let bots through. Of course it's possible to host a private instance of Invidious, but that could be set in the EvoBot config or something.

Edit: API endpoint for retrieving all public instances: https://api.invidious.io/instances.json?pretty=0 It also includes instances on I2P and Tor, so maybe filter them out

dieser-niko commented 3 months ago

I've created a POC written in Python: https://github.com/dieser-niko/invidious_downloader It's not a clean code, but it's working.

I've been running this script for a while and it managed to download 85 out of 86 videos (from Trending) and convert it to mp3. The failed video was not available in any country apparently (https://youtu.be/wKobMz1bbo8). Just a late night talk show.

RiemaruKarurosu commented 2 months ago

What about making a bot music download first, reproduce second, with a one file replace per server?, maybe not the best solution, but it's something.

Edit: maybe you should pin this issue.

SugarD-x commented 2 months ago

What about making a bot music download first, reproduce second, with a one file replace per server?, maybe not the best solution, but it's something.

Edit: maybe you should pin this issue.

I'm not sure personally, but that might be treading into piracy terroritory if it is being downloaded, rather than streamed.

hoangvu12 commented 1 month ago

What about using Invidious? It has a fairly easy to use API. Here's an example: https://invidious.privacyredirect.com/api/v1/videos/dQw4w9WgXcQ Under adaptiveFormats you can choose a custom format depending on what you prefer. There are a few audio-only options to choose from. Then just use the url as a source and you're done.

Obviously Invidious is also suffering from the bot crackdown, so not every public instance will always work. Sometimes the URL to the audio file is invalid, other times the API can't return anything, and some public instances even have Cloudflare in place, which doesn't want to let bots through. Of course it's possible to host a private instance of Invidious, but that could be set in the EvoBot config or something.

Edit: API endpoint for retrieving all public instances: https://api.invidious.io/instances.json?pretty=0 It also includes instances on I2P and Tor, so maybe filter them out

I actually added it to my own fork

https://github.com/hoangvu12/megumin

dieser-niko commented 1 month ago

I've gotta admit, I didn't expect YouTube to crack down this much. Some of the last remaining instances are getting blocked, even their IPv6 ranges.

I haven't tested it yet, but maybe YouTube only blocks on higher usages. Maybe a private Invidious instance might help here. @hoangvu12 are you using public instances in your fork?

hoangvu12 commented 1 month ago

I've gotta admit, I didn't expect YouTube to crack down this much. Some of the last remaining instances are getting blocked, even their IPv6 ranges.

I haven't tested it yet, but maybe YouTube only blocks on higher usages. Maybe a private Invidious instance might help here. @hoangvu12 are you using public instances in your fork?

Yes, I am using a public instance. Also, seems like to host an instance we need a residental ip

https://github.com/iv-org/invidious/issues/4734#issuecomment-2365205990