Skip to content

Conversation

unixfox
Copy link
Member

@unixfox unixfox commented Oct 7, 2024

Description

Invidious companion is the new tool created for the retrieval of the YouTube streams: https://github.com/iv-org/invidious-companion

Invidious will not handle the videos streams retrieval anymore, as it has become a burner for the Invidious team to adapt. Instead, invidious companion will be based on https://github.com/LuanRT/YouTube.js which is the most up to date when it comes to video streams retrieval.

This allows us to spend more time on actually improving the Invidious frontend.

What does this PR do?

Invidious send the /player request to Invidious companion in HTTP(S). Invidious companion does all of its magic then Invidious does the usual parsing of the player endpoint.

Invidious also delegate the work of latest_version, /api/manifest/dash/id and /videoplayback to Invidious companion.

What does invidious companion do

  • You can set multiple invidious_companion. Allowing you to utilize multiple external servers
  • It supports SOCKS proxy - related to Allow to use proxies (HTTP(s) & socks) #301
  • There is a plan to support multiple proxies: handle the ability to use multiple proxies invidious-companion#5
  • There is no need to use inv_sig_helper as the program automatically handle the deciphering.
  • There is no need for youtube-trusted-session-generator as the program automatically generate a po_token at a configurable frequency.
  • You can logging with a yt account

Incompatibilities

  • You can't use inv_sig_helper with invidious companion

Not supported yet - will be work in progress after this PR is merged

Future potential work

  • Have Invidious proxying the requests to Invidious companion in order to make it easier for beginners.

How to try?

Official test docker image for Invidious with this branch "invidious-companion" is available at quay.io/invidious/invidious:companion and quay.io/invidious/invidious:companion-arm64

  1. Run Invidious companion with a secret key: https://github.com/iv-org/invidious-companion?tab=readme-ov-file#run-locally
  2. Configure Invidious companion in the config.yaml and with the same secret key:
invidious_companion:
  - private_url: "http://localhost:8282"
    public_url: "http://localhost:8282"
invidious_companion_key: hoMyBeautifulKey
  1. Run Invidious

Fixes

Related to

Notes

  • docker build for arm64: docker buildx build -f docker/Dockerfile.arm64 --platform=linux/arm64/v8 -t quay.io/invidious/invidious:companion-arm64 --push .
  • docker build for x86: docker buildx build -f docker/Dockerfile --platform=linux/amd64 -t quay.io/invidious/invidious:companion --push .

@unixfox unixfox force-pushed the invidious-companion branch 2 times, most recently from 7efa8f7 to 194fb72 Compare October 20, 2024 00:11
@unixfox unixfox force-pushed the invidious-companion branch from f6d8ddc to a63fca8 Compare November 1, 2024 20:34
@unixfox unixfox changed the title add invidious_companion option Add invidious companion support Nov 1, 2024
@unixfox unixfox requested a review from syeopite November 1, 2024 21:19
@unixfox unixfox marked this pull request as ready for review November 1, 2024 21:19
@unixfox unixfox requested review from SamantazFox and a team as code owners November 1, 2024 21:19
@unixfox
Copy link
Member Author

unixfox commented Nov 5, 2024

Feedback from @Fijxu:
Try to handle busted or IP blocked invidious companions.

@unixfox unixfox force-pushed the invidious-companion branch from 2683b24 to 37df2b4 Compare November 8, 2024 19:28
@unixfox unixfox marked this pull request as draft November 8, 2024 22:44
@unixfox
Copy link
Member Author

unixfox commented Dec 13, 2024

I have just added a new commit for giving invidious companion the ability to verify that the request originated from an invidious watch page.

This allows to combat against bots that will abuse the latest_version endpoint. This verification is not enabled by default in Invidious companion.

I made it on purpose to not include the verification ID for the internal latest_version redirect. Mainly because this would defeat the purpose of combatting bots since the ID would be given by Invidious.

@unixfox unixfox force-pushed the invidious-companion branch from bce789b to 1de2054 Compare December 13, 2024 19:41
@unixfox unixfox marked this pull request as ready for review December 15, 2024 22:27
@unixfox
Copy link
Member Author

unixfox commented Dec 15, 2024

I just marked this PR as ready as I think the code is now production ready.

@SamantazFox @syeopite could you please take a look again at the code? Thanks.

@unixfox unixfox force-pushed the invidious-companion branch from acd5e0c to e57ed1b Compare March 13, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants