feat: player: handle VPN ban and captcha required error messages

This commit is contained in:
ThetaDev 2025-04-23 21:21:23 +02:00
parent d675987654
commit be6da5e7e3
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
3 changed files with 36 additions and 20 deletions

View file

@ -105,6 +105,13 @@ pub enum UnavailabilityReason {
OfflineLivestream,
/// YouTube banned your IP address from accessing the platform without an account
IpBan,
/// YouTube bans IP addresses from certain VPN providers from accessing certain geo-restricted
/// videos.
///
/// If this happens to you, you can try another server / VPN provider or disable your VPN.
VpnBan,
/// YouTube requires the user to solve a ReCaptcha
Captcha,
/// Video temporarily unavailable (rate limit)
TryAgain,
/// Video cant be played for other reasons
@ -125,6 +132,8 @@ impl Display for UnavailabilityReason {
UnavailabilityReason::MembersOnly => f.write_str("members-only"),
UnavailabilityReason::OfflineLivestream => f.write_str("offline stream"),
UnavailabilityReason::IpBan => f.write_str("ip-ban"),
UnavailabilityReason::VpnBan => f.write_str("vpn-ban"),
UnavailabilityReason::Captcha => f.write_str("captcha"),
UnavailabilityReason::TryAgain => f.write_str("try again"),
UnavailabilityReason::Unplayable => f.write_str("unplayable"),
}