-
Notifications
You must be signed in to change notification settings - Fork 420
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] Update clients versions, restore access to some streams and more #1168
[YouTube] Update clients versions, restore access to some streams and more #1168
Conversation
The API keys are not used anymore by official clients in almost all cases (still used by the Android app until it gets a configuration) for all requests we made. Clients and device OS versions have been bumped to their latest stable version known. Methods and fields related to API keys have been renamed or deleted if they're no longer relevant.
YouTube disabled the effectiveness of the parameters which were used (the player response we get redirects to another video), but new parameters which work around Android's client integrity checks have been found.
The new action data can return multiple contact actions instead of only one, which will be concatenated by a new line return. This commit fixes tests of the CrisisResources test class of YoutubeSearchExtractorTest.
YouTube now returns a Shorts tab for InteractiveTabbedHeader gaming channels, which contains Shorts about the game of the topic channel but are not uploaded on the game topic channel. As this tab is already supported by the extractor, fetching a gaming topic channel now returns a tab instead of none. Channel name and channel URL of these Shorts needs to be set to null in a separate commit, as Shorts on this tab do not have the topic channel as their uploader.
I would like to know more about this change. What is DroidGuard's VM? And how did you find out the new player parameters? |
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.
Thank you! Looks mostly good to me, I left just a few nitpicks
...actor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeMetaInfoHelper.java
Outdated
Show resolved
Hide resolved
...actor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeMetaInfoHelper.java
Outdated
Show resolved
Hide resolved
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java
Outdated
Show resolved
Hide resolved
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java
Outdated
Show resolved
Hide resolved
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java
Outdated
Show resolved
Hide resolved
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.
You renamed a lot of things in this class, maybe it would be better to choose a naming that is independent of implementation details? E.g. isHardcodedClientValid
instead of isHardcodedClientVersionValid
. No need to make changes right now unless you have a clear idea, though.
...in/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java
Show resolved
Hide resolved
...src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractorTest.java
Outdated
Show resolved
Hide resolved
See this presentation and reVanced threads about fixing the integrity checks which caused playback issues and our current failure to get streams from the ANDROID client in the extractor: https://www.romainthomas.fr/publication/22-sstic-blackhat-droidguard-safetynet/
|
This PR updates YouTube hardcoded clients' versions to newer ones and removes usage of InnerTube API keys, as official clients do not use them anymore in all endpoints we use.
It also restores the availability some streams (itag 22 on musical videos, itag 139 (+DRC audio streams - used for stable audio feature on mobile apps), when iOS client fetch is not forced, itags 599 and 600) by using new player parameters found to workaround the integrity checks on the official Android app, which requires to pass DroidGuard's VM and to associate a visitor ID to InnerTube requests.
Finally, it adds the missing
prettyPrint
query parameter to mixes continuations and implements the new crisis meta info action data, while fixing YouTube tests and updating mocks on the fly.Due to the removal of the usage of InnerTube API keys, some methods in
YoutubeParsingHelper
which can be used by clients have been changed:areHardcodedClientVersionAndKeyValid
was renamed toisHardcodedClientVersionValid
getKey
was removed, since there is no InnerTube API key anymoreresetClientVersionAndKey
was renamed toresetClientVersion
isHardcodedYoutubeMusicKeyValid
was renamed toisHardcodedYoutubeMusicClientVersionValid
getYoutubeMusicKey
was renamed togetYoutubeMusicClientVersion
and now just returns the version instead of (key, name, version), since there is no key anymore and the name is fixed ("67") and therefore hardcodedCloses #1112, as it is not relevant anymore, and fixes multiple issues which have been not reported as issues in the extractor/NewPipe's issue tracker.