-
-
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
Youtube api improvements #2277
Youtube api improvements #2277
Conversation
Comments and search result aren't returned by the browse() endpoint but by the next() and search() endpoints, respectively.
Should we also implement the others endpoints in this PR and allow to set others clients? |
I was wondering that, too. You don't mind if that ends up rewriting half of your PRs? |
No and that's a good thing. |
59c36d5
to
6577c55
Compare
e77a816
to
72839b8
Compare
And accept gzip compressed data, to help save on bandwidth
72839b8
to
9d2932a
Compare
Here we go, I'm done here. |
Related to #2189 (comment), we will need to manipulate the context. |
Context needs to be manipulatable as shown by recent information
Yeah, I saw that, however, I don't know if that can be provided in any request (We're always using the embed player, so it might fit) or is it required only for age bypass? |
Afaik it should only be required for the age restriction bypass though as shown by recent investigations, using different clients and contexts does provide slightly different functionality. Either way, the context should be configurable through |
That's harder than expected, lol |
We will probably need android embed too in order to solve the throttling issues and directly decrypt the encrypted video streams. |
Sure! I don't know how/where to get those, and probably can't anyway (old, ungoogled phone), so any help is appreciated. |
the problem is that it requires an entire Js engine dependency to be added to invidious, which is something I'd prefer to avoid. See #2222. |
45b7f27
to
56ba453
Compare
@syeopite regarding the ability to modify the context, I tried to implement that, but it's a hell of a nightmare. It seems that crystal (1.0.0, for now) have troubles with merging I.e, the basic So for now, I think it's better to keep things like that, and I'll have to find a way of making better data structures (maybe with a |
But you can technically merge the second level this way: hash1 = {"client" => {"foo" => 1} }
hash2 = {"client" => {"bar" => 1} }
hash1["client"].merge!(hash2["client"])
puts hash1 #{"client" => {"foo" => 1, "bar" => 1}} |
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.
It seems that crystal (1.0.0, for now) have troubles with merging Hash structures.
In that case, this is fine for now.
invidious/src/invidious/helpers/youtube_api.cr
Lines 37 to 42 in 56ba453
ClientType::WebAgeBypass => { | |
name: "WEB", | |
version: "2.20210721.00.00", | |
api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", | |
screen: "EMBED", | |
}, |
Everything else looks pretty good!
I've tried that, and the compiler's not hapy :(
|
847c24d
to
9f616a5
Compare
This PR is intended to unify the implementation of the
next
endpoint. The authors of #2217, #2220, #2227 and #2257 will have to rebase their changes against this PR.Notables changes:
next
endpoint takes data inHash
orNamedTuple
form, so it can be extended in the future, without requiring new function overrides. See documentation in the code for more details.