redtube fix
This commit is contained in:
@@ -3,6 +3,7 @@ use url::Url;
|
||||
use crate::providers::{build_proxy_url, strip_url_scheme};
|
||||
use crate::videos::ServerOptions;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const DOODSTREAM_HOSTS: &[&str] = &[
|
||||
"turboplayers.xyz",
|
||||
"www.turboplayers.xyz",
|
||||
@@ -12,6 +13,7 @@ const DOODSTREAM_HOSTS: &[&str] = &[
|
||||
"www.streamhg.com",
|
||||
];
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn proxy_name_for_url(url: &str) -> Option<&'static str> {
|
||||
let parsed = Url::parse(url).ok()?;
|
||||
let host = parsed.host_str()?.to_ascii_lowercase();
|
||||
@@ -23,6 +25,7 @@ pub fn proxy_name_for_url(url: &str) -> Option<&'static str> {
|
||||
None
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn rewrite_hoster_url(options: &ServerOptions, url: &str) -> String {
|
||||
match proxy_name_for_url(url) {
|
||||
Some(proxy_name) => build_proxy_url(options, proxy_name, &strip_url_scheme(url)),
|
||||
|
||||
Reference in New Issue
Block a user