-
Notifications
You must be signed in to change notification settings - Fork 417
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] Fix buffering by decoding n parameter of stream urls #683
Conversation
Done by transforming the parameter "n" from videoplayback urls ytdl-org/youtube-dl#29326 (comment)
Previously it replaced the parameter itself not the value of the parameter.
I cleaned up the code and added some tests for it. Now it's just waiting to see if the problem still occurs with this change. |
Seeing how the before-clean-up version seems to be working fine for a few days now, I would mark this as ready for review, so we can get this issue fixed |
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.
Looks good. I just pointed out small things.
.../src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeJavascriptExtractor.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeJavascriptExtractor.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeJavascriptExtractor.java
Outdated
Show resolved
Hide resolved
.../test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeJavascriptExtractorTest.java
Outdated
Show resolved
Hide resolved
extractor/src/main/java/org/schabi/newpipe/extractor/utils/Javascript.java
Outdated
Show resolved
Hide resolved
...in/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java
Outdated
Show resolved
Hide resolved
Also address review and rewrite some comments
…me nParam multiple times. Closes TeamNewPipe#689
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.
Code generally looks very good.
However some minor questions / notes came up while reviewing.
Also tested it since >3 days in my experimental NewPipe branch and it works without (major) problems 😄
.../src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeJavaScriptExtractor.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeJavaScriptExtractor.java
Show resolved
Hide resolved
.../src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java
Show resolved
Hide resolved
Use final where possible, annotate some methods and parameters as Nonnull and format new code to be in the 100 characters limit per line.
…lyStreams methods of YoutubeStreamExtractor Without this commit, the n param is only decrypted for streams extracted in getVideoStreams (so only for streams in the formats object of the player response).
.../test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypterTest.java
Outdated
Show resolved
Hide resolved
There are still failing tests, but they are not related to this PR. |
[YouTube] Fix buffering by decoding n parameter of stream urls
I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.No compatibility changesMy attempt at fixing TeamNewPipe/NewPipe#6510 by applying the javascript function to decode n parameter as mentioned here TeamNewPipe/NewPipe#6510 (comment)
I think this implementation is correct, but I could not confirm it because just these changes are not enough to solve the problem. NewPipe itself needs to also apply the decoder on the urls while streaming.
Code is ugly, because I don't 100% know if it is working and did not want to put more time into it