-
Notifications
You must be signed in to change notification settings - Fork 433
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] Workaround HTTP 403s on streaming URLs of WEB client (after some time or instantly for some JavaScript players), update clients info #1197
Conversation
Can't you just use
This is the response for an invalid id:
I don't have a deleted video to test. |
...in/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java
Outdated
Show resolved
Hide resolved
f22ed6d
to
e80515c
Compare
…time These changes work around an anti-bot token, for which its requirement is A/B tested on the WEB client. In this test, streaming URLs of this client return HTTP errors 403 if the token is not provided after some time. It also allows to not fetch the JavaScript player for non-age restricted videos, reducing data usage. The TVHTML5 embed client is now only fetched in the case of age-restricted videos. The methods forceFetchAndroidClient and forceFetchIosClient of YoutubeStreamExtractor have been removed, as they are now not needed anymore. These changes also break the extraction of appropriate error states for private and deleted videos and invalid video IDs.
The "blue whale" search query does not return a crisis resource panel anymore, so it was changed to a different word, "suicide".
- Fix typo in folder name of DescriptionTestPewdiepie test; - Fix constant usage of DownloaderTestImpl as download implementation for UnlistedTest and CCLicensed tests.
This commits fixes extraction of the function name decoding the n parameter for HTML5 clients' streaming URLs for YouTube base JavaScript player 3400486c. Two new regexes have been added to the existing ones. All regexes and what they extract has been documented.
This param used to throttle bandwidth of streaming URLs which have this parameter when the correct value is not provided but it is not the case anymore, as the streaming URLs return now an HTTP response code 403 in this case.
e80515c
to
d73de6b
Compare
This PR works around an anti-bot token, for which its requirement is A/B tested on the WEB client. In this test, streaming URLs of this client return HTTP errors 403 if the token is not provided after some time.
It also allows to not fetch the JavaScript player for non-age restricted videos, reducing data usage. The TVHTML5 embed client is now also only fetched in the case of age-restricted videos.
forceFetchAndroidClient
andforceFetchIosClient
ofYoutubeStreamExtractor
have been removed, as they are now not needed anymore. This is a breaking change for users of these methods.The PR changes also break the extraction of appropriate error states for private and deleted videos and invalid video IDs (an invalid player response message is thrown instead of a content not available one). This should fixed before this PR is merged, but I can't find a solution, so I will need help for that.
Clients info have been updated, this means that mocks have to be updated and several tests unrelated to my changes are failing. I fixed one in this PR (at least for the connection I used to ran the tests),
YoutubeSearchExtractorTest.CrisisResources
.Fixes TeamNewPipe/NewPipe#11191.