fix: disable Android client

This commit is contained in:
ThetaDev 2024-11-25 15:48:04 +01:00
parent 706e88134c
commit a846b729e3
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
3 changed files with 3 additions and 4 deletions

View file

@ -321,8 +321,7 @@ static VISITOR_DATA_REGEX: Lazy<Regex> =
/// ///
/// The order may change in the future in case YouTube applies changes to their /// The order may change in the future in case YouTube applies changes to their
/// platform that disable a client or make it less reliable. /// platform that disable a client or make it less reliable.
pub const DEFAULT_PLAYER_CLIENT_ORDER: &[ClientType] = pub const DEFAULT_PLAYER_CLIENT_ORDER: &[ClientType] = &[ClientType::Tv, ClientType::Ios];
&[ClientType::Tv, ClientType::Android, ClientType::Ios];
/// The RustyPipe client used to access YouTube's API /// The RustyPipe client used to access YouTube's API
/// ///

View file

@ -198,7 +198,7 @@ impl MapResponse<VideoPlayer> for response::Player {
"Premium" => Some(UnavailabilityReason::Premium), "Premium" => Some(UnavailabilityReason::Premium),
"members-only" => Some(UnavailabilityReason::MembersOnly), "members-only" => Some(UnavailabilityReason::MembersOnly),
"country" => Some(UnavailabilityReason::Geoblocked), "country" => Some(UnavailabilityReason::Geoblocked),
"Android" | "websites" => Some(UnavailabilityReason::UnsupportedClient), "version" | "websites" => Some(UnavailabilityReason::UnsupportedClient),
"bot" => Some(UnavailabilityReason::IpBan), "bot" => Some(UnavailabilityReason::IpBan),
_ => None, _ => None,
}) })

View file

@ -30,7 +30,7 @@ use rustypipe::validate;
#[case::desktop(ClientType::Desktop)] #[case::desktop(ClientType::Desktop)]
#[case::tv(ClientType::Tv)] #[case::tv(ClientType::Tv)]
#[case::mobile(ClientType::Mobile)] #[case::mobile(ClientType::Mobile)]
#[case::android(ClientType::Android)] // #[case::android(ClientType::Android)]
#[case::ios(ClientType::Ios)] #[case::ios(ClientType::Ios)]
#[tokio::test] #[tokio::test]
async fn get_player_from_client(#[case] client_type: ClientType, rp: RustyPipe) { async fn get_player_from_client(#[case] client_type: ClientType, rp: RustyPipe) {