doodstream and lulustream in sxyprn integrated
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -3,25 +3,41 @@ use url::Url;
|
||||
use crate::providers::{build_proxy_url, strip_url_scheme};
|
||||
use crate::videos::ServerOptions;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const DOODSTREAM_HOSTS: &[&str] = &[
|
||||
"doodstream.com",
|
||||
"turboplayers.xyz",
|
||||
"www.turboplayers.xyz",
|
||||
"trailerhg.xyz",
|
||||
"www.trailerhg.xyz",
|
||||
"streamhg.com",
|
||||
"www.streamhg.com",
|
||||
];
|
||||
|
||||
const LULUSTREAM_HOSTS: &[&str] = &[
|
||||
"luluvdo.com",
|
||||
"lulustream.com",
|
||||
];
|
||||
|
||||
const VIDARA_HOSTS: &[&str] = &[
|
||||
"vidara.so",
|
||||
];
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn proxy_name_for_url(url: &str) -> Option<&'static str> {
|
||||
let parsed = Url::parse(url).ok()?;
|
||||
let parsed = match !url.starts_with("http://") && !url.starts_with("https://"){
|
||||
true => Url::parse(&format!("https://{}", url)).ok()?,
|
||||
false => Url::parse(url).ok()?
|
||||
};
|
||||
let host = parsed.host_str()?.to_ascii_lowercase();
|
||||
|
||||
if DOODSTREAM_HOSTS.contains(&host.as_str()) {
|
||||
return Some("doodstream");
|
||||
}
|
||||
|
||||
if LULUSTREAM_HOSTS.contains(&host.as_str()) {
|
||||
return Some("lulustream");
|
||||
}
|
||||
|
||||
if VIDARA_HOSTS.contains(&host.as_str()) {
|
||||
return Some("vidara");
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user