privacy-redirect icon indicating copy to clipboard operation
privacy-redirect copied to clipboard

Randomize Instance on Refresh

Open ChocoTonic opened this issue 3 years ago • 19 comments

I noticed that sometimes an instance will fail to load, so I'll have to go back to where I clicked on a link to get a new instance if I have the randomized option selected.

could you add a feature to allow for randomizing instances on refresh, say if any of the domains in the list are detected?

ChocoTonic avatar Sep 04 '20 10:09 ChocoTonic

This is interesting indeed. It would be even better if we could somehow detect when an instance doesn't work (a 404 page or the like) and automatically use another instance.

tiotrom avatar Sep 04 '20 11:09 tiotrom

detection isn't necessary, just load another instance or alternate to selected instances to avoid certain instances that tend not to work. I personally only use a couple of instances and I'd love to be able to swap between them if I can on reload

ChocoTonic avatar Sep 04 '20 13:09 ChocoTonic

I understand but now with the introduction of random instances, it will happen that at times some randomized instances won't load. And users won't know what to do rather than try to load the same url again. So it would be perfect if it can be detected that an instance doesn't work so it quickly replaces (reloads) with another one. You make it much easier for everyone. Yes, you and I can simply use certain instances that we know they work, but most people probably just want an instance to load automagically. Not to keep an eye and review which instances are best and then use those...

So I think that if we somehow could detect when an instance prints-out a loading error (like not working) it immediately chooses another instances and reloads the page. Idk if this is super easy or impossible to implement tho...

tiotrom avatar Sep 04 '20 13:09 tiotrom

I'm not sure how the extension would become aware of 404s for Invidious instances, as atm it just intercepts the original request and then returns the alternative URL to the browser, it isn't aware of the outcome.

I'm curious, doesn't the extension already radomise the instances on refresh? The intention was to get a random instance every time a redirect occurred if the user hasn't selected a specific instance.

SimonBrazell avatar Sep 07 '20 01:09 SimonBrazell

Oh wait do you mean if the user refreshes the failed invidious page?

SimonBrazell avatar Sep 07 '20 01:09 SimonBrazell

I'm not sure how the extension would become aware of 404s for Invidious instances, as atm it just intercepts the original request and then returns the alternative URL to the browser, it isn't aware of the outcome.

It is true, can be difficult to read that. Invidious prints out such messages image Could that be detected?

I'm curious, doesn't the extension already radomise the instances on refresh?

Yup it does

Oh wait do you mean if the user refreshes the failed invidious page?

Thats also one way to do it.

tiotrom avatar Sep 07 '20 01:09 tiotrom

Ideally it should operate as @tiotrom suggests, detecting failed requests to the instances and redirecting to another one, but I'm not sure how to achieve this at the moment, need to look into it.

SimonBrazell avatar Sep 07 '20 01:09 SimonBrazell

That would be really great!

tiotrom avatar Sep 07 '20 02:09 tiotrom

my original suggestion is much simpler to implement thant detecting a failed instance.

I would just have a set or list of instances, check if the curent URL is the original domain, youtube.com or Twitter.com, or one of the private domains and upon refres, change to an instance that isn't the current one

ChocoTonic avatar Sep 07 '20 18:09 ChocoTonic

Problem is neither of these are quick to implement.

@tiotrom's suggestion would need to include a new script which would run on all the instances, detecting some error text and then doing a redirect.

@ChocoTonic's suggestion would require that the extension not just redirects YT links to Invidous but also Invidious links to Invidious, which is fine but how do I then know if the trigger was a refresh or a genuine Invidious link that someone clicked, plus maybe there are instances where the user actually wants to refresh an invidious page?

EDIT - feel free to correct me if I've gotten off track here, maybe I haven't understood properly.

SimonBrazell avatar Sep 09 '20 05:09 SimonBrazell

in my suggestion, I would have a user select preferred instances to rotate through (personally I only have 2 invidious instances I prefer), randomly or not, or have them enter the urls in comma separated string or checkboxes however you prefer the setting to be set up

and upon refresh, regardless of whether it were a click on a link or a refresh will pick a random instance that's user designated, so that would include the replacement of youtube to invidious and any invidious link to a randomly chosen invidious instance based on what was user defined.

ChocoTonic avatar Sep 09 '20 09:09 ChocoTonic

I'd say we need less friction for users. Meaning, if you ask users to do this and that, then you lose most of them. People want things to work. I am fine with testing which instances are better and using only a few - I am testing them on a daily basis but even so, at times some may work great, at times they may not. But asking my mother or my sister to do the same, it wont work.

@SimonBrazell is right, how can we know if a user refreshes an invidious instace or they simply visit an instance? Or they simply want to refresh the same instance...the best and most useful would be if the script could detect if an instance doesn't work, and quickly loads another one. I know SearX has searx.space where they have bots checking each SearX instance every day and rates them based on their response, thus providing a repository of working instances. And something like https://searx.neocities.org/ picks the best entries at random when doing a search. Isn't Invidious having something similar? How are they detecting the "health" status here https://www.invidio.us/?

tiotrom avatar Sep 09 '20 11:09 tiotrom

So, I am someone who watches youtube videos daily from many channels. We have a curated videos for our website https://www.tromsite.com/tools/videos. I can tell you that with the randomize thing implemented Invidious for example works kinda 50% of the time. But same goes if you choose a specific instance. Which is not going to be usable for most people. Nitter and Bibliogram seem to work a lot better.

So, something must be done about Invidious since it is really difficult to use it when it fails around 50% of the time. :D

tiotrom avatar Sep 09 '20 12:09 tiotrom

the point of changing instances on refresh is because the instance you're on may not be working as you said, which is the origin of the suggestion, so I'm not sure what point you're trying to make

ChocoTonic avatar Sep 09 '20 16:09 ChocoTonic

Invidious for example works kinda 50% of the time.

Seems Invidious is in a bit of a state right now, may not recover given the official instance is gone and there are no developers working on the project.

So, something must be done about Invidious since it is really difficult to use it when it fails around 50% of the time.

I'm not sure what the solution to this is, especially if the reliability is intermittent, I'd say the extension could ping each instance periodically to see if they are available but that won't solve the problem if the instance is available but some videos still don't work. Perhaps we could devise a more comprehensive test that the extension could perform on each instance to determine reliability ourselves?

in my suggestion, I would have a user select preferred instances to rotate through (personally I only have 2 invidious instances I prefer), randomly or not, or have them enter the urls in comma separated string or checkboxes however you prefer the setting to be set up

This could work, allow the user to control the pool of random instances, perhaps I could change the instance inputs to either allow a single or a comma separated entry, and treat the comma separated entry differently.

SimonBrazell avatar Sep 10 '20 00:09 SimonBrazell

and upon refresh, regardless of whether it were a click on a link or a refresh will pick a random instance that's user designated, so that would include the replacement of youtube to invidious and any invidious link to a randomly chosen invidious instance based on what was user defined.

This actually sounds a lot like #50 as it would require making not only YT but also Invidious links trigger the redirects, also helps with #66 and persisting Invidious settings / parameters without using cookies. So I'll see what I can do, maybe make this an additional setting, something like "Redirect Invidious request to chosen instance", which would achieve what you want if I also add the pool thing mentioned above.

SimonBrazell avatar Sep 10 '20 00:09 SimonBrazell

Maybe test the instances like invidio.us does it now https://github.com/iv-org/invidious/issues/1366#issuecomment-689703070 - ping it to test it. And choose instances based on that? Redirecting invidious to other invidious instances upon refresh can also be helpful.

I think there are these issues with instances:

  1. They get overloaded. Too many people trying to access them.
  2. They may not work properly or at all.

And a few solutions to mitigate the issues:

  1. Randomize instances to not put a huge load on any.
  2. Ping instances from time to time to see which one works, which one doesn't, and choose from the ones who work in the randomize process.
  3. Maybe detect errors with some instances if possible, and do as in point 2.
  4. Refresh an instance to another instance. This way the user can manually fix the issue with instances not working.
  5. Add the selection of instances in the drop down menu and maybe let users select multiple of them, like checkboxes in the dropdown.

This is what I see :)

tiotrom avatar Sep 10 '20 00:09 tiotrom

I tried to achieve the "random different instance" on invidious by clicking on the "Watch on Youtube" Link that is offered by invidious. But this request is not redirected, so this doesn't help.

Wurzelkoch avatar Feb 26 '21 14:02 Wurzelkoch

The problem still occurs with nitter instances which frequently fail to load. Having to copy paste a twitter link several times to finally find a working instance is tedious. A "select another random instance" button would be useful.

hydrargyrum avatar Jan 04 '22 17:01 hydrargyrum