Lavalink
Lavalink copied to clipboard
Allow setting YouTube timeout
Possibly a workaround for #274, unless there is a different underlying cause
This helps me!
Are you able to add a property for the timeout for generic HTTP(S) streams as well? This would be extremely useful for me. I have a system where sometimes I pass Lavalink the YouTube stream URL directly instead of using the LavaPlayer loader. These stream URLs time out after the classic 3000 ms because Lavalink doesn't consider them to be YouTube. I'd like to adjust that timing too.
@cloudrac3r I am a bit stumped by your request. Generic YouTube stream URLs?
In Lavaplayer, the YouTube source provider gets asked if a given URL corresponds to it. The generic HTTP loader (which doesn't work for YouTube!) gets asked as one of the last source providers. If the HTTP provider truly tries to load it, it should be evident by the stack trace.
Though that doesn't explain your problem. The track loader API that Lavalink uses to load Lavaplayer tracks is the same that we use for playing tracks. In theory, we use the same HTTP client in both cases.
Hmm. Can you tell me exactly which kinds of outgoing requests are affected by the youtubeTimeout setting?
Should be anything sent by YoutubeAudioSourceManager
, which should be anything to youtube.com.
Could you post your stack trace?
The urls in question are for anything.googlevideo.com
. I don't have logs or a stack trace of this at the moment, but I'll be sure to provide them when I next notice this happening.
Now that makes more sense. I'm surprised you're getting a timeout on whatever cache is near you. Some large media providers like YouTube and Netflix have caching servers located with local ISPs.
We can change the timeout of the HTTP manager, though I don't particularly like the idea of using special config parameters like this. Perhaps a more generic config format would be nicer. Though I am not sure what that would look like.
I tried the specific googlevideo URL on a few machines in different regions and IIRC it was slow in all of them. Just YouTube being YouTube. Next time I'm affected I will do a proper investigation and write down my findings for you.
This PR in its current form is definitely an improvement for normal use, though.
I haven't had issues with timeouts since I last commented.
Hey @freyacodes , I have a similar issue. I have attempted to setup ipv6 addresses using your guide (although I am using a /64 subset from hetzner, I did also try the /48 on a VPS), and I seem to be getting a timed out error. Sorry if this is a dumb question, but where can I try out this build? I tried the Dev build from the CL but it looks like it's not been merged yet, I also tried to build this repo with the changes, but was unsuccessful.
My error is here: https://cdn.mrrazamataz.ga/data/lavalinkipv6%20error.txt
Thank you.
The problem is with your network configuration. Setting a higher timeout will not help.
The problem is with your network configuration. Setting a higher timeout will not help.
Would you have any idea what I have done wrong? I have read your guide and the only bit I didnt do was the getting a /48 block as I had a /64 set that came with my machine from hetzner. Would you know any possible cause/fix?
Yes, my ping6 tests are successful.