hoangvu12 / megumin

A fork of EvoBot (Discord Music Bot) that uses Invidious.
MIT License
2 stars 0 forks source link

🐛 Error: No audio formats found #13

Open HyperKids opened 1 day ago

HyperKids commented 1 day ago

Describe the bug "Error: No audio formats found" when attempting to play a song/video

How To Reproduce Steps to reproduce the behavior:

  1. Fresh install - Debian, started via pm2
  2. Queue a song/video with /play

Expected behavior Error does not occur

Environment (add if possible)

Additional information & screenshots

4|npm  | Error: No audio formats found
4|npm  |     at Song.makeResource (/root/megumin/structs/Song.ts:73:24)
4|npm  |     at processTicksAndRejections (node:internal/process/task_queues:95:5)
4|npm  |     at async MusicQueue.processQueue (/root/megumin/structs/MusicQueue.ts:192:24)

Song shows up as "undefined" in queue

hoangvu12 commented 1 day ago

I believe this error occurred because the Invidious instance failed to return audio formats, which is unrelated to the bot. You can try changing the instance.

HyperKids commented 1 day ago

I've tried three different Invidious instances. Am I perhaps formatting the link wrong in config? I'm using the format https://invidious.link.here.

hoangvu12 commented 1 day ago

I've tried three different Invidious instances. Am I perhaps formatting the link wrong in config? I'm using the format https://invidious.link.here.

Make sure that you can actually watch videos on the instance, try many different videos because some videos are cached.

HyperKids commented 1 day ago

Okay, I see what is going on. All the Invidious instances listed require login - the only one as of writing that works without login is inv.nadeko.net (which doesn't work if I'm trying to host this on a VPS due to CloudFlare). invidious.jing.rocks seems to work for search, but anything under the /api/v1/videos/ endpoint returns "This content isn't available, try again later".

This can probably be closed? Seems that there's just a lack of public Invidious instances that don't require login. Or perhaps the answer is to add authentication support.

hoangvu12 commented 1 day ago

Can you list instances that require to login? I'll give it a look and try to implement it.

HyperKids commented 1 day ago

You can pull pretty much any URL from this uptime list, but I'll list a few below:

These ones say "Please sign in" when hitting the /api/v1/videos/<videoid> endpoint:

These ones say "This content isn't available" when hitting the /api/v1/videos/<videoid> endpoint:

I assume the "This content isn't available" errors are the Invidious instance getting blocked, and that there's nothing we can do about it.

hoangvu12 commented 1 day ago

Ah, actually "Please sign in" is an error from YouTube, not from the Invidious. https://github.com/iv-org/invidious/issues/4975

HyperKids commented 1 day ago

Okay, I found an Invidious instance that is working (I've emailed you directly with the URL). Everything works when setting USE_INVIDIOUS_PROXY to true!

About the error, that's a big yikes - seems like instances everywhere are getting blocked.

hoangvu12 commented 1 day ago

That's nice to hear, YouTube been blocking Invidious really hard recently. I guess we can't do anything until Invidious team comes up with a good solution.