vidara proxy for sxyprn

This commit is contained in:
Simon
2026-05-05 08:58:26 +00:00
committed by ForgeCode
parent 60d29ca905
commit 8ae0fcb544
8 changed files with 212 additions and 178 deletions

View File

@@ -70,46 +70,8 @@ impl SxyprnProxy {
println!("tmp: {:?}", tmp);
let sxyprn_video_url = format!("https://sxyprn.com{}", tmp.join("/"));
println!("sxyprn_video_url: {}", sxyprn_video_url);
// let response = requester.get_raw_with_headers(&sxyprn_video_url, vec![
// ("Accept".to_string(), "*/*".to_string()),
// // ("Accept-Encoding".to_string(), "identity".to_string()),
// // ("Accept-Language".to_string(), "de,en-US;q=0.9,en;q=0.8".to_string()),
// // ("Cache-Control".to_string(), "no-cache".to_string()),
// // ("Connection".to_string(), "keep-alive".to_string()),
// ("Host".to_string(), "sxyprn.com".to_string()),
// // ("Pragma".to_string(), "no-cache".to_string()),
// // ("Priority".to_string(), "u=4".to_string()),
// // ("Range".to_string(), "bytes=0-".to_string()),
// // ("Referer".to_string(), url.clone()),
// // ("Sec-Fetch-Dest".to_string(), "video".to_string()),
// // ("Sec-Fetch-Mode".to_string(), "no-cors".to_string()),
// // ("Sec-Fetch-Site".to_string(), "same-origin".to_string()),
// // ("Sec-GPC".to_string(), "1".to_string()),
// // ("TE".to_string(), "trailers".to_string()),
// ("User-Agent".to_string(), "curl/8.5.0".to_string())
// ])
// .await;
// match response {
// Ok(resp) => {
// println!("Response headers: {:?}", resp.headers());
// println!("Response status: {}", resp.status());
// return format!(
// "https:{}",
// resp.headers()
// .get("location")
// .unwrap()
// .to_str()
// .unwrap_or("")
// .to_string()
// );
// }
// Err(e) => {
// println!("Error fetching video URL: {}", e);
// }
// }
match crate::util::get_redirect_location(&sxyprn_video_url) {
Ok(Some(loc)) => {println!("Redirect target found: {}", loc); return format!("https:{}", loc)},
Ok(Some(loc)) => {return format!("https:{}", loc)},
Ok(None) => println!("No redirect found for {}", sxyprn_video_url),
Err(e) => eprintln!("Request failed: {}", e),
}