Join GitHub today
Tell visitors if the current instance is blocked #875
It is possible for Invidious to know if it is blocked or not by examining the response it receives from YouTube. If a request failed because the instance is blocked, relevant information should be shown to the user.
The main way this would be displayed is as a more specific message on the error page.
Similarly, whether the request was blocked should be provided in API responses. This could either be designed as a custom message for the
A field should also be added to /api/v1/stats to show whether any recent requests on this instance were blocked or not, to help automated processes decide if the instance is blocked or not without having to put extra load on it by requesting a video page. "Recent" could be as simple as "the latest one".
This will help users tell the difference between "the video URL is wrong", "the video was removed", and "this instance is blocked, so nothing is available right now".
Perhaps a page explaining how this blocking works should be created and linked in the error page, so that users that are unfamiliar with YouTube's recent automated request policies can understand what is happening. I would be willing to help write this article.
Elaboration: I think this should be implemented as a JSON API, either part of /api/v1/stats or perhaps its own endpoint, which displays the timestamp of that instance's most recent video request (e.g. 1576286344) and whether that request was blocked or not (true/false). This would allow automated tools to detect if an instance is blocked or not without having to put additional load on it with a /api/v1/videos request.