redtube fix

This commit is contained in:
Simon
2026-04-07 12:32:41 +00:00
parent a7e38c97a6
commit 81e8158161
5 changed files with 160 additions and 111 deletions

View File

@@ -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)),