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

Bugfix: Extract visitor data from sw.js_data API instead of randomly… #1271

Closed
wants to merge 3 commits into from

Conversation

sheepmax
Copy link

@sheepmax sheepmax commented Feb 1, 2025

In #1262, visitor data was randomly generated for the iOS client, but this has recently broken. This PR tries to extract this data from https://www.youtube.com/sw.js_data as suggested by @gechoto in TeamNewPipe/NewPipe#11980. Works on NewPipe, with the expected behaviour of videos properly loading. Also took it for a spin with a bike ride :)

The solution doesn't feel very robust, but further work on parsing the all the data coming from this endpoint is not something I'm knowledgeable about.

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

@AudricV
Copy link
Member

AudricV commented Feb 1, 2025

Thanks for your PR.

I used a different approach which has the benefit of getting a visitorData with a specific InnerTube client from two InnerTube endpoints in #1272, so I'm closing this PR in favor of the one I linked.

Once again, I thank you for your pull request and I am sorry to have to close it :(

@AudricV AudricV closed this Feb 1, 2025
@AudricV AudricV added bug Issue is related to a bug youtube service, https://www.youtube.com/ labels Feb 1, 2025
@sheepmax
Copy link
Author

sheepmax commented Feb 1, 2025

No worries, @AudricV. I mostly wanted a quick fix for myself, your solution looks much more robust of course. If I may ask, I'm very new to this and confused about where to learn about inner API details. How do you do it yourself?

@Atemu
Copy link

Atemu commented Feb 4, 2025

@AudricV given that there hasn't been any significant movement on #1272 in the past few days and that it does quite a bit more than just apply a quick fix to make things work again, could we have this merged first and then simply reverted whenever #1272 is ready to roll?

@AudricV
Copy link
Member

AudricV commented Feb 5, 2025

No, that's not something we plan to do.

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

Successfully merging this pull request may close these issues.

3 participants