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

Fix comments parsing #477

Merged
merged 1 commit into from
Dec 9, 2020
Merged

Conversation

vkay94
Copy link
Contributor

@vkay94 vkay94 commented Dec 9, 2020

  • 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.

This PR should fix the annoying comments parsing error discussed in #455 in NewPipe by converting the responseBody into a "valid" format by escaping specific characters. When using the mobile user-agent the ytInitialData is formatted with chars as \x, which can't be parsed correctly.

Test NewPipe apk (just changed the implementation link to this PR's branch): app-debug.zip

PS: Out of some reason I can't reply to the linked issue, so I'm responding to your question here, @TobiGr :

is it possible to convert the unicode characters to utf-8 automatically? Who knows whether they decide to encode other special chars, too.
It there is no simple solution to this, I'd go with your proposed changes,

I've done some research on the headers and so. As said above the reason for this character mess-up is the mobile User-Agent which is required to get the necessary token - without or normal/desktop User-Agent it's formatted well but does contain a different token used for the desktop way, explained in detail in #457 (but the desktop version has also its problems because of POST and CORS protection).

Copy link
Member

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@TobiGr TobiGr merged commit 6fbcdd2 into TeamNewPipe:dev Dec 9, 2020
@TobiGr TobiGr added bug youtube service, https://www.youtube.com/ labels Dec 9, 2020
@vkay94 vkay94 deleted the fix-comments-parsing branch December 9, 2020 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants