FreeTubeApp / FreeTube

An Open Source YouTube app for privacy
https://freetubeapp.io/
GNU Affero General Public License v3.0
13.5k stars 837 forks source link

[Feature Request]: Inform users that they have to select an invidious instance with api enabled #3161

Open efb4f5ff-1298-471a-8973-3d47447115dc opened 1 year ago

efb4f5ff-1298-471a-8973-3d47447115dc commented 1 year ago

Guidelines

Problem Description

In https://github.com/FreeTubeApp/FreeTube/pull/2714 we filtered out the invidious instances that don't support the API.

Usecase: User clicks on 'View all Invidious instance information' and goes to https://api.invidious.io/. User selects an instance that doesnt support the API.

I think we have to inform the user that they need to select an instance that supports the api before they go to https://api.invidious.io/

Proposed Solution

Make the user aware in the '?' toast or put the warning after 'View all Invidious instance information' which seems like a better idea to me.

Alternatives Considered

This is an addition to the proposed solution: If user still selected an instance from https://api.invidious.io/ that doesnt support the api, we should display a warning like this instance isnt supported or something.

Issue Labels

display more information to user

Additional Information

No response

efb4f5ff-1298-471a-8973-3d47447115dc commented 1 year ago

Some enhancements for this enhancement courtesy of @absidue

  1. Check if the URL starts with http:// or https://, if it doesn't show an error, telling the user to add it
  2. Ping the /api/v1/stats endpoint, that way we can check if the instance is reachable and if there even is an instance at that URL (that endpoint seems to be enabled for all invidious servers), if we don't get a successful response, we show an error saying that we couldn't find an invidious instance at that URL and that they should check for typos
  3. Ping the trending endpoint to check if the instance has the API enabled, if we get a response that isn't successful we show an error saying that the instance doesn't have the API enabled
  4. Some instances don't support proxying the videos, so if the user has that setting enabled, we should do an extra check to see if it is enabled, currently what happens if an instance have it disabled, when the player tries to fetch the stream, the server returns an HTTP 403 with an HTML page that says "Administrator has disabled this endpoint.", as we only proxy the DASH formats, the player falls back to the legacy formats which don't get proxied.*

*This is going to either require changes on the invidious side or we fetch the full info for a YouTube video and then we also try to download a chunk of the video stream. This is probably something that we shouldn't even consider implementing into the settings checks