-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add NewPipeExtractor for stream extraction #1772
base: dev
Are you sure you want to change the base?
Conversation
Lots of duplicates of the issue, so I'm gonna mention them so they all get a mention back here and we get more testers: #1753 #1754 #1757 #1758 #1760 #1764 #1765 #1770 For people who want a briefing on this: It seems like this issue is an API change on youtube's side, specific to users logged into a youtube account. Logging out fixes playback, but not for age-restricted content. For people reporting that the debug build and outertune works, it's just working because haven't tried logging into their accounts. In the case of outertune the root issue is not fixed, but login appears to work because of their hotfix 0.6.4: "Please note that this uses the "logged out" method of song playback for ALL song playback, and as a result, content that you need to be logged in for (and possibly age-restricted content) would be inaccessible." tldr: If you'd like to try and help test the fallback implemented above, you can download the auto-generated debug build which contains it: |
It works fine with non-age-restricted content while logged in now, but attempting to stream age-restricted content (While logged in with 18+ google account) crashes the app. Digging through logcat now to find out why. Never tried debugging something like this before so lmk if you know of a better method and I'll post whatever debug info I can scrounge up. For reference I'm on lineageOS using microg so it's possible this issue is specific to my device setup, but considering that the login feature worked fine before it's likely this crash will happen similarly on other devices. |
The errors of note:
Then exo player then throws an exception ( Not sure if the firebase error is because I didn't set up some debugging tool on my end, but it looks like the real issue lies in the newpipe extractor being unable to play the age-restricted content. The same video plays without login in newpipe so I figure it's possible to work around. |
Thank you for testing! Well, it seems adding the login cookie to the requests isn't enough for age restricted videos, unfortunately. About the last crash, I don't think it's a problem on your end, it's probably a problem with the GitHub action that builds the apk, I don't think Crashlytics should be trying to send crashes in testing builds anyway... But you say that the age restricted video is playing for you in NewPipe? Can you put the video link here? |
Only adding the cookie does nothing.
Now the problem is that this way of sending the login only works for requests with the web client. But NewPipeExtractor makes two requests:
|
Ooh I didn't know that, then I guess this solution won't work for age restricted songs. It could still be useful as a fallback when the native methods from InnerTune don't work, but seeing that right now InnerTune also uses IOS client to get the streams I'm not sure if it's worth adding NewPipeExtractor as a fallback... |
as well as for all other things that need login which is a notable downgrade since the IOS client does not support login anymore (or nobody knows how) the logic should be:
But I don't know how to tell NewPipeExtractor to use a specific client. @javdc what do you think about this:
This way we also still have all the metadata and normalization will still work. I think this could be tested in a separate PR. I would like to keep this one as kind of an archive in case we need this approach later. |
Just so you know, PR #1690 already handles signature deobfuscation, but it also uses clients that don't work anymore. If that PR is updated I think we could do everything natively
No problem! |
Even with updated clients the urls produced by this PR don't work anymore. I guess using NewPipeExtractor for deobfuscation will be easier to maintain. |
Use NewPipeExtractor as a method to obtain song info and stream URLs. Currently this is only a proof of concept.
Advantages
Disadvantages
To do
I need testers! Please try this with a YouTube account and age restricted content. I only tried it without logging in, my account is not age verified and I won't give Google my ID card just to try this. I added the login cookie to NewPipeExtractor requests, so I think it should work, but I'm not sure.