Modern Apps git

← Modern-Apps.git

youpipe: #92 SABR 2C - LocalDomPoTokenProvider emits raw po-token bytes for sabrng session

Commit
fe509882ae267ba70f0da20d74aa97c2f1fc52d6
Author
vayun-mathur <[email protected]>
When
2026-08-16 18:02 UTC (3 months ago)
Parents
bd1ce81

Diff

youpipe/src/main/java/com/vayunmathur/youpipe/util/sabr/LocalDomPoTokenProvider.kt
diff --git a/youpipe/src/main/java/com/vayunmathur/youpipe/util/sabr/LocalDomPoTokenProvider.kt b/youpipe/src/main/java/com/vayunmathur/youpipe/util/sabr/LocalDomPoTokenProvider.ktindex 4698932b2f..2f9d9e3e17 100644--- a/youpipe/src/main/java/com/vayunmathur/youpipe/util/sabr/LocalDomPoTokenProvider.kt+++ b/youpipe/src/main/java/com/vayunmathur/youpipe/util/sabr/LocalDomPoTokenProvider.kt@@ -195,11 +195,22 @@ class LocalDomPoTokenProvider(context: Context) :         info: YoutubeSabrInfo,         streamState: YoutubeSabrStreamState,         forceRefresh: Boolean,+    ): ByteArray? = getPoTokenBytes(info.videoId, info.visitorData, forceRefresh)++    /**+     * Raw PO token bytes for the session-based SABR stack ([SabrNgSession]); mirrors+     * [getPoToken] but takes the videoId/visitorData directly so it does not depend on the legacy+     * `YoutubeSabrInfo`/`YoutubeSabrStreamState` types.+     */+    @JvmOverloads+    fun getPoTokenBytes(+        videoId: String,+        visitorDataHint: String?,+        forceRefresh: Boolean = false,     ): ByteArray? {         val credentialIdentity = currentCredentialIdentity(currentlyLoggedIn())         credentialIdentityTracker.observe(credentialIdentity)-        val videoId = info.videoId-        val visitorData = info.visitorData ?: synchronized(visitorDataLock) {+        val visitorData = visitorDataHint ?: synchronized(visitorDataLock) {             fetchedVisitorData         } ?: throw SabrProtocolException("Missing visitorData for Local DOM PO token")         if (forceRefresh) {