fix(youtube): clarify missing player response errors#71
Conversation
|
Can you take a look at these two? They have the same error but seem not the COPPA case. |
|
Yep of course, I'm gonna take a look at them |
|
Yep, I took a look at both :) For #2456, the stack trace goes through For #2482, it is related but not exactly the same case. The reported video is: With normal extraction it works locally. When I simulate a slow/missing WEB player metadata response, the stream extraction still succeeds, but optional metadata extraction can produce errors because So my current read is: This PR currently only handles the |
Context from TypeType issue:
Priveetee/TypeType#72
Related SABR work:
Related PipePipe issue:
Summary
TypeType issue #72 surfaced a YouTube extraction failure where the frontend received:
I reproduced the null
playerResponsepath locally by delaying the player response, then checked the affected Made for Kids / COPPA examples to understand the underlying playback failure.This PR does not fix playback for those videos. That appears to be in the SABR / login-required area already being explored in #69.
This PR only makes the failure explicit and user-actionable instead of surfacing as a null
playerResponsecrash.Problem
YoutubeStreamExtractor.onFetchPage()currently skips playability checks whenplayerResponse == null.If no usable player response was fetched,
fetchPage()can still return, and later getters such asgetName()assumeplayerResponseexists.That turns a YouTube extraction failure into a
NullPointerException, which makes the real cause harder to understand and harder to surface to users.Findings
Tested examples:
Observed locally:
There is a possible workaround using the Safari player response. In local testing it returned progressive streams for the affected videos.
I am intentionally not adding that fallback here because I do not like the tradeoff: it is fragile, it changes stream selection behavior, and it would paper over the actual SABR-related issue instead of fixing it.
The long-term fix is likely in the SABR area, which is already being explored in #69. Until then, affected users should try logging in if they need an immediate workaround.
Changes
Try logging in.in the error shown for this failure path.Try logging in.when YouTube returns thepage needs to be reloadederror.playerResponsecrash to users.Validation
git diff --check./gradlew :extractor:compileJava --no-daemonplayerResponsecrash with a delayed player response.Notes
This does not implement SABR playback and does not add a Safari fallback.
The affected COPPA/SABR cases still require SABR support or login/tokens. This PR only improves the failure mode and tells users to try logging in instead of surfacing an internal null crash.