You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the Invidious instance was selected at random, failures in one would not break jimmi.xyz entirely. This is very easy to add in the current code without any complicated rearchitecturing.
Motivation
When an instance gets rate limited (like what happened to the current one) there's a 0% chance !play will work. If more instances are added this lower bound can be increased a lot.
Additional information
I can code this myself, but I don't have a node development setup so I cannot test what I write. It could be as simple as
function randomChoice(arr) {
return arr[Math.floor(arr.length * Math.random())];
}
function baseUrl() {
return randomChoice(["https://vid.puffyan.us", "https://yewtu.be", "https://yt.artemislena.eu"]) // Include other instances that have a tick in API in https://api.invidious.io/ (allowed API access)
}
And then use this.baseUrl() when fetching.
The text was updated successfully, but these errors were encountered:
This is something we considered previously and which should be part of #69 (EPYC to refactor everything YouTube related into its own reusable module).
The consideration was to not only select instances at random, but rather give the user full choice of which invidious instance to use, so that users could also provide their self-hosted instances.
I currently do not have the time to develop this feature myself, but if you have the time to setup a development environment and test your changes I'd be happy to welcome a PR ;)
Summary
If the Invidious instance was selected at random, failures in one would not break jimmi.xyz entirely. This is very easy to add in the current code without any complicated rearchitecturing.
Motivation
When an instance gets rate limited (like what happened to the current one) there's a 0% chance !play will work. If more instances are added this lower bound can be increased a lot.
Additional information
I can code this myself, but I don't have a node development setup so I cannot test what I write. It could be as simple as
And then use
this.baseUrl()
when fetching.The text was updated successfully, but these errors were encountered: