Add invidious companion support#4985
Merged
unixfox merged 32 commits intoiv-org:masterfrom Mar 13, 2025
Merged
Conversation
4 tasks
7efa8f7 to
194fb72
Compare
f6d8ddc to
a63fca8
Compare
syeopite
requested changes
Nov 5, 2024
SamantazFox
reviewed
Nov 5, 2024
Member
Author
|
Feedback from @Fijxu: |
SamantazFox
reviewed
Nov 7, 2024
2683b24 to
37df2b4
Compare
syeopite
reviewed
Nov 9, 2024
97ae26c to
1aa154b
Compare
SamantazFox
requested changes
Nov 19, 2024
Member
Author
|
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. |
bce789b to
1de2054
Compare
Fijxu
reviewed
Dec 14, 2024
Member
Author
|
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. |
acd5e0c to
e57ed1b
Compare
NorkzYT
pushed a commit
to NorkzYT/invidious
that referenced
this pull request
Nov 16, 2025
* add support for invidious companion * redirect latest_version and dash manifest to invidious companion * fix Shadowing outer local variable `response` * fixing condition for Content-Security-Policy * throw error if inv_sig_helper and invidious_companion used same time * Use sample instead of Random.rand Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> * Remove debug puts functions Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> * modify the description for config.example.yaml about invidious companion * move config checks for invidious companion * separate invidious_companion logic + better config.yaml config * fixing "end" misplacement * fix linting + use .empty? * crystal handle decompression already by itself * fix download function when invidious companion used * fix linting * invidious companion always used so always add CSP and redirect latest_version * apply all the suggestions + rework invidious_companion parameter * format watch.cr * fix ameba Redundant use of `Object#to_s` in interpolation * add ability for invidious companion to check request from invidious * Better document private_url and public_url * Better doc for invidious_companion_key * !empty? to present? * skip proxy for invidious companion * fixing format * missing , * add companion pooling http * fix: don't use http proxy when sending requests to companion * fix: logic where we want to have the invidious logic if companion is not used * chore: remove baseurl usage from invidious companion * chore: change from inv-sig-helper to companion for required playback * fix: use puts + add warning for inv-sig-helper deprecated --------- Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/idand/videoplaybackto Invidious companion.What does invidious companion do
Incompatibilities
Not supported yet - will be work in progress after this PR is merged
Future potential work
How to try?
Official test docker image for Invidious with this branch "invidious-companion" is available at
quay.io/invidious/invidious:companionandquay.io/invidious/invidious:companion-arm64Fixes
Related to
Notes
docker buildx build -f docker/Dockerfile.arm64 --platform=linux/arm64/v8 -t quay.io/invidious/invidious:companion-arm64 --push .docker buildx build -f docker/Dockerfile --platform=linux/amd64 -t quay.io/invidious/invidious:companion --push .