diff --git a/src/client/mod.rs b/src/client/mod.rs index 06386bc..f3304f0 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -100,7 +100,11 @@ impl ClientType { } fn needs_deobf(self) -> bool { - !matches!(self, ClientType::Ios) + // Android + iOS InnerTube paths return pre-signed stream URLs (no &s= cipher, + // no &n= throttling param), so they don't need player.js deobfuscation at all. + // Skipping the deobf fetch here keeps the player path alive even when YouTube + // rotates the player.js to a shape our extractor doesn't recognise. + !matches!(self, ClientType::Ios | ClientType::Android) } fn needs_po_token(self) -> bool { diff --git a/src/client/player.rs b/src/client/player.rs index 9bae601..1fd00ab 100644 --- a/src/client/player.rs +++ b/src/client/player.rs @@ -245,10 +245,15 @@ 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. if self.client.inner.botguard.is_some() { - &[ClientType::Desktop, ClientType::Ios, ClientType::Tv] + &[ClientType::Android, ClientType::Ios, ClientType::Desktop, ClientType::Tv] } else { - &[ClientType::Ios, ClientType::Tv] + &[ClientType::Android, ClientType::Ios, ClientType::Tv] } }