freeuseporn
This commit is contained in:
@@ -60,9 +60,13 @@ impl DoodstreamProxy {
|
||||
}
|
||||
|
||||
fn request_headers(detail_url: &str) -> Vec<(String, String)> {
|
||||
let origin = Self::request_origin(detail_url).unwrap_or_else(|| "https://turboplayers.xyz".to_string());
|
||||
let origin = Self::request_origin(detail_url)
|
||||
.unwrap_or_else(|| "https://turboplayers.xyz".to_string());
|
||||
vec![
|
||||
("Referer".to_string(), format!("{}/", origin.trim_end_matches('/'))),
|
||||
(
|
||||
"Referer".to_string(),
|
||||
format!("{}/", origin.trim_end_matches('/')),
|
||||
),
|
||||
("Origin".to_string(), origin),
|
||||
(
|
||||
"Accept".to_string(),
|
||||
@@ -224,9 +228,11 @@ impl DoodstreamProxy {
|
||||
|
||||
fn extract_pass_md5_url(text: &str, detail_url: &str) -> Option<String> {
|
||||
let decoded = text.replace("\\/", "/");
|
||||
let absolute_regex =
|
||||
Self::regex(r#"https?://[^\s"'<>]+/pass_md5/[^\s"'<>]+"#)?;
|
||||
if let Some(url) = absolute_regex.find(&decoded).map(|value| value.as_str().to_string()) {
|
||||
let absolute_regex = Self::regex(r#"https?://[^\s"'<>]+/pass_md5/[^\s"'<>]+"#)?;
|
||||
if let Some(url) = absolute_regex
|
||||
.find(&decoded)
|
||||
.map(|value| value.as_str().to_string())
|
||||
{
|
||||
return Some(url);
|
||||
}
|
||||
|
||||
@@ -276,7 +282,8 @@ impl DoodstreamProxy {
|
||||
requester: &mut Requester,
|
||||
) -> Option<String> {
|
||||
let pass_md5_url = Self::extract_pass_md5_url(html, detail_url).or_else(|| {
|
||||
Self::unpack_packer(html).and_then(|unpacked| Self::extract_pass_md5_url(&unpacked, detail_url))
|
||||
Self::unpack_packer(html)
|
||||
.and_then(|unpacked| Self::extract_pass_md5_url(&unpacked, detail_url))
|
||||
})?;
|
||||
|
||||
let headers = vec![
|
||||
@@ -311,7 +318,9 @@ impl crate::proxies::Proxy for DoodstreamProxy {
|
||||
return url;
|
||||
}
|
||||
|
||||
if let Some(url) = Self::resolve_stream_from_pass_md5(&detail_url, &html, &mut requester).await {
|
||||
if let Some(url) =
|
||||
Self::resolve_stream_from_pass_md5(&detail_url, &html, &mut requester).await
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -370,7 +379,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn composes_media_url_from_pass_md5_response() {
|
||||
let pass_md5_url = "https://trailerhg.xyz/pass_md5/abc123/def456?token=t0k3n&expiry=1775000000";
|
||||
let pass_md5_url =
|
||||
"https://trailerhg.xyz/pass_md5/abc123/def456?token=t0k3n&expiry=1775000000";
|
||||
let body = "https://g4vsrqvtrj.pinebrookproductionlab.shop/1ghkpx2e8jnal/hls3/01/08534/syyzvotfnhaa_l/master.txt";
|
||||
assert_eq!(
|
||||
DoodstreamProxy::compose_pass_md5_media_url(pass_md5_url, body).as_deref(),
|
||||
|
||||
Reference in New Issue
Block a user