51 lines
1.6 KiB
Rust
51 lines
1.6 KiB
Rust
use crate::proxies::doodstream::DoodstreamProxy;
|
|
use crate::proxies::pornhd3x::Pornhd3xProxy;
|
|
use ntex::web;
|
|
|
|
use crate::proxies::pimpbunny::PimpbunnyProxy;
|
|
use crate::proxies::porndish::PorndishProxy;
|
|
use crate::proxies::spankbang::SpankbangProxy;
|
|
use crate::{proxies::sxyprn::SxyprnProxy, util::requester::Requester};
|
|
|
|
pub mod doodstream;
|
|
pub mod hanimecdn;
|
|
pub mod hqpornerthumb;
|
|
pub mod javtiful;
|
|
pub mod noodlemagazine;
|
|
pub mod pimpbunny;
|
|
pub mod pimpbunnythumb;
|
|
pub mod porndish;
|
|
pub mod porndishthumb;
|
|
pub mod pornhd3x;
|
|
pub mod spankbang;
|
|
pub mod sxyprn;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub enum AnyProxy {
|
|
Doodstream(DoodstreamProxy),
|
|
Sxyprn(SxyprnProxy),
|
|
Javtiful(javtiful::JavtifulProxy),
|
|
Pornhd3x(Pornhd3xProxy),
|
|
Pimpbunny(PimpbunnyProxy),
|
|
Porndish(PorndishProxy),
|
|
Spankbang(SpankbangProxy),
|
|
}
|
|
|
|
pub trait Proxy {
|
|
async fn get_video_url(&self, url: String, requester: web::types::State<Requester>) -> String;
|
|
}
|
|
|
|
impl Proxy for AnyProxy {
|
|
async fn get_video_url(&self, url: String, requester: web::types::State<Requester>) -> String {
|
|
match self {
|
|
AnyProxy::Doodstream(p) => p.get_video_url(url, requester).await,
|
|
AnyProxy::Sxyprn(p) => p.get_video_url(url, requester).await,
|
|
AnyProxy::Javtiful(p) => p.get_video_url(url, requester).await,
|
|
AnyProxy::Pornhd3x(p) => p.get_video_url(url, requester).await,
|
|
AnyProxy::Pimpbunny(p) => p.get_video_url(url, requester).await,
|
|
AnyProxy::Porndish(p) => p.get_video_url(url, requester).await,
|
|
AnyProxy::Spankbang(p) => p.get_video_url(url, requester).await,
|
|
}
|
|
}
|
|
}
|