Repository navigation
Description
What happened?
YouTube SABR playback fails across multiple videos (e.g. kIo2BAubO6k, 3T0ayXcUAhE, R1-j8TFlqCo) under both MWEB and WEB profiles when YouTube returns UMP part 46 (RELOAD_PLAYER_RESPONSE).
I tried debugging and patching Part 46 locally, but ran into a deeper UNPLAYABLE rejection on reload and couldn't get playback working end-to-end. I am sharing my live traces and findings below so you can hopefully take a look when you have a moment:
-
PipePipeExtractor:SabrReloadPlayerResponsedecodes 3 protobuf layers instead of 2SabrReloadPlayerResponse.decode(byte[])expects 3 nested messages (1 -> 1 -> 1), whereas live UMP part46only has 2 layers (parts=[46:148], wireFields=[46={1=bytes(145)}], where innerfield 1is directly the 142-byte UTF-8 token stringCj8a...%3D).- Treating the token string as a nested protobuf message causes ASCII
'3'(0x33) to throwSabrProtocolException: Unsupported protobuf wire type: 3, whichSabrResponseDecoderswallows intomalformedPartswithout settingreloadRequested = true.
-
PipePipeExtractor: After fixing Part 46 decoding,reloadSabrInforeturnsUNPLAYABLE- When I patched
SabrReloadPlayerResponselocally to 2 layers (malformedParts=[],reload=true),YoutubeSabrSession.maybeReload(...)calledYoutubeSabrProbe.reloadSabrInfo(...)sendingplaybackContext.reloadPlaybackContext.reloadPlaybackParams.token. /youtubei/v1/playerreturned HTTP200withplayabilityStatus.status = UNPLAYABLE("Video unavailable"/"This content isn't available."),adaptiveFormats = 0, andserverAbrStreamingUrl = null.- Consequently,
maybeReloadreturnsfalseon the very first reload (reloads=1) and throws a misleadingSabrReloadException: SABR requested player reload ... (reload budget spent). - Additionally,
maybeReloadpassespoTokenProvider = null(unlikerotatePendingAttestationIdentity) and does not callstreamState.resetServerSessionState()or resetrequestNumber.
- When I patched
-
TypeType-Server: Silent pumpExtractionException& VOD watchdog retry loopSabrSessionPumpLoop.ktcatchesExtractionException(includingSabrReloadException) and callsholder.failTerminal(error.message)without logging throughSabrPumpLogger, leaving no pump error trace in server logs on initial playback (startTimeMs=0).SabrVodDemandExpiration.expireInFlightinterrupts withRESTARTand clears the demand without counting consecutive zero-progress expirations, causingPOST /sabr/playback/{sessionId}to keep polling202until client timeout when Part46is swallowed.
Steps to reproduce
- Attempt to play YouTube videos
kIo2BAubO6k,3T0ayXcUAhE, orR1-j8TFlqCovia SABR (reproduced under bothMWEBandWEBprofiles, both viatypetype-tokenand directYoutubeSabrProbe.fetchSabrInfo). - Observe YouTube returning UMP Part
46(RELOAD_PLAYER_RESPONSE) onn=1(aftern=0Part43SABR_REDIRECTor Part57/67/35backoff). - In unpatched code, Part
46is swallowed asmalformedPartsand the player polls202indefinitely until timeout. - With Part
46patched to 2-layer decoding,YoutubeSabrSession.maybeReloadsendsplaybackContext.reloadPlaybackContext.reloadPlaybackParams.tokento/youtubei/v1/playerand receivesUNPLAYABLE(serverAbrStreamingUrl = null), failing immediately with(reload budget spent).
Area
Backend (API / extraction)
Channel
beta
Anything else?
Observed Live SABR Exchange
- Path A (
MWEBviatypetype-token):n=0-> HTTP 200 UMPparts=[43:1089](SABR_REDIRECT,urlLength=1086)n=1(to redirected URL,poTokenBytes=92) -> HTTP 200 UMPparts=[46:148](RELOAD_PLAYER_RESPONSE,reloadPlaybackParamsTokenLength=142)
- Path B (direct
YoutubeSabrProbe.fetchSabrInfoforMWEBorWEB):n=0-> HTTP 200 UMPparts=[57:92, 67:2, 35:5]57=[type=5, scope=4, valueBytes=82, sendByDefault=true, writePolicy=2, value=timing=timestampMs=.../durationMs=4000/content=contentIdLength=23/contentType=1, signatureBytes=37, field5=2]67=[id=1]35=[backoff=4000, cookie=bytes(0)]
n=1(after 4s backoff) -> HTTP 200 UMPparts=[46:148](RELOAD_PLAYER_RESPONSE,reload=true)
Decoded reloadPlaybackParams.token Payload
Sample token (142 chars):
Cj8aAwoBASILa0lvMkJBdWJPNmsqJDNpMnUvSzlvemdseURUUy9qZ1NtSklnVUFEcjNveDFWcTU0djCQteCVnjQSJQEyjDJ5oJTjWD6MZq1_Q_dvW6YDrTBPJh4ed9vXps3v80eL_R4%3D
URL-decoding & Base64-decoding it shows valid protobuf containing the videoId, a 36-char token ID, a future expiry timestamp, and a signature.
/youtubei/v1/player Comparison (same IP, same MWEB/WEB client, visitorData, and poToken)
- Without
reloadPlaybackContext:- HTTP
200,playabilityStatus.status = OK,adaptiveFormats = 31(MWEB) /30(WEB),serverAbrStreamingUrl = present
- HTTP
- With
playbackContext.reloadPlaybackContext.reloadPlaybackParams.token:- HTTP
200,playabilityStatus.status = UNPLAYABLE(reason: "Video unavailable","This content isn't available."),adaptiveFormats = 0,serverAbrStreamingUrl = null - Reproduced across both
MWEBandWEB, with samecpnvs freshcpn, withserviceIntegrityDimensions.poTokenvs without, and both with raw%3DandURLDecoder.decode-ed=. - (Note: If
reloadPlaybackContextis placed at top-level instead of underplaybackContext,/playerignores it and returnsOK, but the fresh SABR session immediately hits the same43/57->46cycle.)
- HTTP
Relevant Code Locations
PipePipeExtractor:SabrReloadPlayerResponse.java(L15–37),SabrResponseDecoder.java,YoutubeSabrSession.java(L614–647, L2013–2016),YoutubeSabrProbe.java(L780–786)TypeType-Server:SabrVodDemandExpiration.kt(L6–37),SabrSessionPumpLoop.kt(L62–64)
Notes for Investigation
Based on my debugging, here are the areas that seem to be involved if you have a chance to look into it:
- Updating
SabrReloadPlayerResponseto decode 2 protobuf layers instead of 3. - Figuring out how YouTube expects the
Part 57 (type=5, scope=4, contentType=1)->Part 46reload flow (andsabrContext) to be handled so/youtubei/v1/playerreturns playablestreamingDatainstead ofUNPLAYABLE, as well as passingthis.poTokenProviderand resettingstreamState/requestNumberinYoutubeSabrSession.maybeReload. - In
TypeType-Server, loggingExtractionExceptionviaSabrPumpLoggerinSabrSessionPumpLoop.kt, and handling consecutive zero-progress expirations recoverably inSabrVodDemandExpiration.ktinstead of polling202indefinitely.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
Priveetee commentedon Nov 15, 2026
man i dont know how u got this, but this, this is a real diamond thanks