diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/net/IosSafeHttpDataSource.kt b/strawApp/src/main/kotlin/com/sulkta/straw/net/IosSafeHttpDataSource.kt index 4e9eb7583..ffb92672f 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/net/IosSafeHttpDataSource.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/net/IosSafeHttpDataSource.kt @@ -162,6 +162,12 @@ class IosSafeHttpDataSource( } companion object { - const val DEFAULT_CHUNK_BYTES: Long = 1L * 1024 * 1024 + // YT's iOS-bound googlevideo URLs accept bounded `Range: bytes=N-M` + // requests up to roughly 900 KiB before flipping to 403. Empirically + // measured 2026-05-24 on Lucy egress: bytes=0-917503 (~896 KiB) → 206; + // bytes=0-999999 (~977 KiB) → 403. 512 KiB gives a 2× safety margin — + // small enough to survive future tightening, large enough to keep the + // open() round-trip count tolerable for a long video. + const val DEFAULT_CHUNK_BYTES: Long = 512L * 1024 } }