Skip to content
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

[Findings] Non rate limited YouTube Mobile API #568

Closed
FireMasterK opened this issue Mar 4, 2021 · 9 comments · Fixed by #604
Closed

[Findings] Non rate limited YouTube Mobile API #568

FireMasterK opened this issue Mar 4, 2021 · 9 comments · Fixed by #604
Labels
youtube service, https://www.youtube.com/

Comments

@FireMasterK
Copy link
Member

We can use getKey() from YoutubeParsingHelper as any API key works.

User-Agent is spoofing a Pixel 4 XL using last year's August Update on Android 10.

Please download ARC to open these files.

arc rest client files.zip

I will not be able to implement this considering the complexity of managing the existing Desktop API and the new Mobile API while not breaking anything.

@unixfox
Copy link

unixfox commented Mar 5, 2021

Maybe this could mean a more stable way to extract information from YouTube?
Parsing HTML pages is not stable because it is known that YouTube is constantly changing them. Using an internal API could allow a more stable API because they need to keep outdated YouTube apps on Android working for a long time.

@AudricV AudricV added the youtube service, https://www.youtube.com/ label Mar 5, 2021
@AudricV AudricV changed the title [Findings] Non rate limited Mobile API [Findings] Non rate limited YouTube Mobile API Mar 5, 2021
@B0pol
Copy link
Member

B0pol commented Mar 5, 2021

I'm not sure about that, at some point it just shows an update screen.

This a screenshot from my old phone, almost two years without update but still, they probably don't support for a long time API changes but just show this screen.

@unixfox
Copy link

unixfox commented Mar 5, 2021

I'm not sure about that, at some point it just shows an update screen.

This a screenshot from my old phone, almost two years without update but still, they probably don't support for a long time API changes but just show this screen.

Two years is a very very long time. Compared to a breaking change from YouTube every month if we have an API stability of at least 6 months then it's way better.

@AudricV
Copy link
Member

AudricV commented Mar 6, 2021

Also, we can update the YouTube app version at each new extractor release and test if there is not breaking changes in the extraction.

@FireMasterK
Copy link
Member Author

image

You would have to change the player endpoint to /youtubei/v1/next if you haven't done that already.

@FireMasterK
Copy link
Member Author

@FireMasterK /youtubei/v1/next returns 1.3 MB of data, I might as well just parse the HTML at youtube.com/watch?v=, as it will be smaller by at least half.

That's hence why the official app uses protobuf.

@FireMasterK
Copy link
Member Author

Yes, add &alt=proto, you would get a 300kb response instead.

Alternatively (and also the best practice): send a protobuf request instead of a JSON one.

@FireMasterK
Copy link
Member Author

Nope, you can try with: https://youtubei.googleapis.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&alt=proto

That's what I used.

@arstoo6001
Copy link

youtubei/v1/account/get_profile_card > request payload because it is a protobuf message without proto file we cannot analyze

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@unixfox @FireMasterK @B0pol @AudricV @arstoo6001 and others