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 1 year ago • 9 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
  • closes #4073
  • Closes #5435

unixfox avatar Oct 13 '24 17:10 unixfox

Thank you very much for this. Looking at instance yewtu.be which uses invidious-custom, it seems to be working just as expected, exactly as described in my linked issue, and with a 100% success rate.

Thank you for this great work - this is a huge step towards making Invidious convenient to use again. For me personally, it solves the entire problem.

The only thing I can potentially suggest is for the video thumbnail to be loaded and displayed on the page, separately from the broken video player. But that would be just a nice-to-have feature, and I'm guessing it may not be trivial to implement, when the official Youtube website just shows a black error screen, with the thumbnail nowhere to be seen.

ic-scm avatar Oct 17 '24 08:10 ic-scm

Integrate the embed page with the changes

To clarify, does this mean using the YouTube embedded player within the usual invidious video page? I know it wouldn't be "privacy respecting" in the same way as traditional invidious, so maybe as a sort of optional "compatibility mode" in the settings?

 

It sounds like some people have suggested something similar but instead mention just linking to the embed URL (youtube.com/embed/fo0bArBAZ) - I couldn't find anyone suggesting to directly embed the actual embedded YouTube player right on invidious.

(heck, I found out that you can even use various custom adblock filters to hide the "fluff" of the embed player such as suggestions & recommendations, and even end-screen video links/thumbnails, which makes me wonder if even invidious could similarly do that on the server side, or if that's only possible on the client side.)

...and now as I'm typing this, I'm remembering that YouTube supposedly has a newer type of embedded player that's "brandless" and lacks the fluff? Maybe that'd be better to use for embedding into the invidious video page...except, now that I review where I read about it, sounds like it's not something the user can choose and it's determined by the video channel itself?

 

Honestly my main use of invidious is just avoiding the "modern" bloated web page design of "javascript all of the things!" and the like, hence why I tend to still use invidious for navigating youtube even if I subsequently watch a video via the youtube.com/embed/fo0bArBAZ page

NintendoManiac64 avatar Feb 19 '25 03:02 NintendoManiac64

To clarify, does this mean using the YouTube embedded player within the usual invidious video page?

No, it would just mean displaying video info even if the player is unable to be rendered for whatever reason. Everything will still be in Invidious.

syeopite avatar Feb 19 '25 05:02 syeopite

This should also close https://github.com/iv-org/invidious/issues/4073

ChunkyProgrammer avatar Mar 18 '25 18:03 ChunkyProgrammer

Found this via #4744 . Is there any feedback still needed? Can I do something to help this move forward?

mk-pmb avatar Mar 19 '25 05:03 mk-pmb

@mk-pmb There is still all the reviews that needs to be taken care off.

If you know about crystal, I would be happy to receive some contribution. If that's what you can help us, feel free to do a PR on my branch: https://github.com/unixfox/invidious/tree/use-only-next-for-extra-info or create a new PR in the invidious project :).

unixfox avatar Mar 19 '25 07:03 unixfox

I don't know crystal but I can try and replicate your changes based on current master, with the suggestions from this thread applied. :+1:

mk-pmb avatar Mar 19 '25 16:03 mk-pmb

@unixfox I'd like to discuss my draft branch with you, but your repo doesn't have issues. Would you mind creating a git branch use-only-next-for-extra-info-base 70e4eb7f in your repo so I can open a merge request for that? Then we can discuss there.

mk-pmb avatar Mar 19 '25 20:03 mk-pmb

hello @mk-pmb, yes sure sorry for the delay. I have created the branch: https://github.com/unixfox/invidious/tree/use-only-next-for-extra-info-base

I have opened the issues on my fork too.

I have a better idea, I invited you as a collaborator on my forked invidious repo, this way it will be easier to work on the branch use-only-next-for-extra-info directly. Don't screw up my others branches please :smile:

Thanks

unixfox avatar Mar 21 '25 23:03 unixfox