From 70355dd969638cfcea9c575e570536b8c4ef4149 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 6 Apr 2026 06:40:31 +0000 Subject: [PATCH] pimpbunny thumb proxy --- src/providers/pimpbunny.rs | 27 +++------------------------ src/proxies/mod.rs | 1 - src/proxy.rs | 5 ----- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/providers/pimpbunny.rs b/src/providers/pimpbunny.rs index e43190f..267d4c2 100644 --- a/src/providers/pimpbunny.rs +++ b/src/providers/pimpbunny.rs @@ -178,30 +178,9 @@ impl PimpbunnyProvider { } } - fn is_allowed_thumb_url(url: &str) -> bool { - let Some(url) = Url::parse(url).ok() else { - return false; - }; - if url.scheme() != "https" { - return false; - } - let Some(host) = url.host_str() else { - return false; - }; - matches!(host, "pimpbunny.com" | "www.pimpbunny.com") - && url.path().starts_with("/contents/videos_screenshots/") - } - fn proxied_thumb(&self, options: &ServerOptions, thumb: &str) -> String { - if thumb.is_empty() || !Self::is_allowed_thumb_url(thumb) { - return thumb.to_string(); - } - - crate::providers::build_proxy_url( - options, - "pimpbunny-thumb", - &crate::providers::strip_url_scheme(thumb), - ) + let _ = options; + thumb.to_string() } fn is_allowed_detail_url(url: &str) -> bool { @@ -911,7 +890,7 @@ mod tests { assert_eq!( proxied, - "https://example.com/proxy/pimpbunny-thumb/pimpbunny.com/contents/videos_screenshots/517000/517329/800x450/1.jpg" + "https://pimpbunny.com/contents/videos_screenshots/517000/517329/800x450/1.jpg" ); } diff --git a/src/proxies/mod.rs b/src/proxies/mod.rs index 1fe4adb..307214e 100644 --- a/src/proxies/mod.rs +++ b/src/proxies/mod.rs @@ -19,7 +19,6 @@ pub mod hqpornerthumb; pub mod javtiful; pub mod noodlemagazine; pub mod pimpbunny; -pub mod pimpbunnythumb; pub mod porndish; pub mod porndishthumb; pub mod pornhd3x; diff --git a/src/proxy.rs b/src/proxy.rs index f5a9113..5d777cd 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -105,11 +105,6 @@ pub fn config(cfg: &mut web::ServiceConfig) { .route(web::post().to(crate::proxies::pornhubthumb::get_image)) .route(web::get().to(crate::proxies::pornhubthumb::get_image)), ); - cfg.service( - web::resource("/pimpbunny-thumb/{endpoint}*") - .route(web::post().to(crate::proxies::pimpbunnythumb::get_image)) - .route(web::get().to(crate::proxies::pimpbunnythumb::get_image)), - ); } async fn proxy2redirect(