invidious icon indicating copy to clipboard operation
invidious copied to clipboard

trying to only use next endpoint for the major data

Open unixfox opened this issue 4 months ago • 1 comments

Description

This PR aims to avoid throwing a raw error and instead display all the data that we can extract from the /next endpoint but without displaying the "player" (video.js) element.

This is one big step towards https://github.com/iv-org/invidious/pull/4985. Invidious will have to be able to display the watch page even when YouTube is blocking the IP.

This will give the same result as on www.youtube.com:

This way the user can still view the title of the video, accessing the channel page, viewing the comments and much more which is not yet blocked.

What changed?

  • The watch page is displayed properly but without the player if an error is found.
  • All the important data like title, viewcount is fetched from /next endpoint is unable from the /player endpoint.
  • The error message now throws the reason AND the subreason. Makes it clearer to the user what's really happening.

TODO

  • [ ] Integrate the embed page with the changes
  • [ ] Display the subreason on the watch page when there is an error
  • [ ] Fix description
  • [ ] Add mocks for a video without videoDetails

Try these videos ID for testing - on both a blocked IP and a not blocked one

  • 98TyXNPdMRo (private video)
  • 7KSfDyainYU (georestricted video)
  • KIuDBxqz__k (familySafe no)
  • yqaS07znJWY (unlisted video)
  • aaaaaaaaaaaa (notfound video)

Fixes

  • Closes #4744

unixfox avatar Oct 13 '24 17:10 unixfox