-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add invidious companion support #4985
base: master
Are you sure you want to change the base?
Conversation
7efa8f7
to
194fb72
Compare
f6d8ddc
to
a63fca8
Compare
Feedback from @Fijxu: |
2683b24
to
37df2b4
Compare
97ae26c
to
1aa154b
Compare
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
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. |
Co-authored-by: syeopite <[email protected]>
Co-authored-by: syeopite <[email protected]>
a5acdde
to
568081b
Compare
note: there is technically no need to store some kind of baseUrl from companion since we already have this info in "public_url" parameter from config.yaml and we could remove this too in invidious companion |
# Proxy needs to be reinstated every time we get a client from the pool | ||
conn.proxy = make_configured_http_proxy_client() if CONFIG.http_proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Proxy needs to be reinstated every time we get a client from the pool | |
conn.proxy = make_configured_http_proxy_client() if CONFIG.http_proxy |
|
||
@pool = DB::Pool(HTTP::Client).new(options) do | ||
companion = CONFIG.invidious_companion.sample | ||
next make_client(companion.private_url, force_resolve: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next make_client(companion.private_url, force_resolve: true) | |
next make_client(companion.private_url, use_http_proxy: false) |
conn.close | ||
|
||
companion = CONFIG.invidious_companion.sample | ||
conn = make_client(companion.private_url, force_resolve: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conn = make_client(companion.private_url, force_resolve: true) | |
conn = make_client(companion.private_url, use_http_proxy: false) |
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
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:companion
andquay.io/invidious/invidious:companion-arm64
Fixes
Related to