client: prefer iOS over Android in default order

Android-only path requires Google device attestation (po_token /
botguard signing). iOS path has neither attestation nor sig deobf
requirements, so it's the cleanest "just works" default. Keep
Android in the rotation only when botguard is wired.
This commit is contained in:
Kayos 2026-05-24 11:50:56 -07:00
parent 765a90e808
commit a6df2ff7f4

View file

@ -245,15 +245,16 @@ impl RustyPipeQuery {
/// The order may change in the future in case YouTube applies changes to their
/// platform that disable a client or make it less reliable.
pub fn player_client_order(&self) -> &'static [ClientType] {
// Default to the InnerTube clients that don't need player.js deobfuscation
// (Android, iOS). Tv is kept as a final fallback for when the mobile clients
// return degraded responses. Desktop is only used when botguard is wired
// (po_token signing) because it otherwise serves obfuscated URLs we can't
// currently deobf on YT's newer player versions.
// Default to iOS first — it skips player.js deobfuscation entirely (pre-signed
// stream URLs) AND doesn't require device attestation the way the Android
// client does. Tv is the secondary fallback (it does need a sig_timestamp
// request param, but its responses are typically OK). Android is included
// when botguard/po_token signing is wired because then we can satisfy YT's
// device attestation requirement.
if self.client.inner.botguard.is_some() {
&[ClientType::Android, ClientType::Ios, ClientType::Desktop, ClientType::Tv]
&[ClientType::Ios, ClientType::Android, ClientType::Tv, ClientType::Desktop]
} else {
&[ClientType::Android, ClientType::Ios, ClientType::Tv]
&[ClientType::Ios, ClientType::Tv]
}
}