New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion : Add option to automatically pick a random invidious instance #42
Comments
I'm not sure it is either practical nor useful (also, I don't really like the idea of choosing an instance without the user knowing)... |
This instance may be choosen between the list used in preferences. |
I like the idea, though I doubt it would be usable at the moment since few of the instances seem to be working reliably. I guess one would run into errors a lot. OTOH having an option in the settings (and having it turned off by default) wouldn't hurt. Cheerz@lekma and a big thanks for bringing yt back to kodi ❤ |
Yeah, that's true but when some instances are overcharged, we need to go to preferences and change to another, test, and try another.. These could be automatically done by check a random instance. |
similar is done by Privacy Redirect: SimonBrazell/privacy-redirect#48 |
I think this'd be a valuable feature. However, it'd be best to implement it differently, more like what DJCrashdummy pitched with If I understand this issue correctly, it load balances requests across instances by choosing a random one per action. This is nice for reducing the load on individual instances. However, not a very practical given servers are scattered across the world, so latency varies widely. I'm also wary that there'll be issues with consistency, depending on how aggressively instances cache content. It'd be annoying if sometimes you go to a channel, the latest video is there, and other times it isn't. Instead, I'd like to see an option available called Auto. It'd ping each public instance, and choose one based on latency. There will be a map to back off instances if they returned errors recently. Whenever the selection takes place, it'll notify the user of what server it switched to. For example, given the list of instances, it will use example.com:
If while using example.com, it runs into a timeout, forbidden, or some other error:
It'd be better if it retried requests too, and switched again as necessary. This could be in a separate iteration though, having Auto without automatic retries would be a good start. |
I've been working on my proposed solution, and found flaws with it. There's no platform-agnostic way to ping hosts with Python, and it's not worth concerning over platform specifics or using a library. To keep logic platform-agnostic, I tried doing HTTP request to the My WIP implementation: Probably best to scrap latency. So, the new proposal: There'd be a setting called Auto-switch instances. If enabled, we continue to use the instance the user has configured, and allows the user to reconfigure it whenever they want. Whenever an error occurs, such as a timeout, rate limit, or internal server error, we add the current instance to a backoff list for 24-hours. Meanwhile, we switch to another instance and notify the user. Assuming the user selected an instance in a region they're happy with (privacy laws, latency, etc), we'd try to keep them in the same region. When picking a new instance, we pick one in the same region with the best health, or if there are no others in that region, just the one with the best health in general. |
@SethFalco: I'm still not convinced it is either practical or useful... |
I thought it'd be quite nice. I'll just note the use-case I had in mind, but welcome to disagree with it. 👍 Sometimes instances can be unreliable. Even the large instances like A request failing occurs at least every other day, but is usually fine. It's just a retry away. However, around every 1-2 weeks, it's bad enough that I have to flip between instances, which is a chore especially when watching with others. The recent merge with regions showing in the menu is very helpful, but it'd be better if the failures were effectively invisible, imo. If that doesn't seem like a worthwhile reason, I'll shelve this and explore other avenues to improve UX. For example:
|
I suggest to add an option wich can be disabled to automatically pick a random invidious instance (to avoid 500 error)
straw-viewer is using this option :
https://github.com/trizen/straw-viewer/blob/master/README.md#invidious-instances
The text was updated successfully, but these errors were encountered: