javtiful fix

This commit is contained in:
Simon
2026-03-29 17:05:32 +00:00
parent 243d19cec0
commit 4e95354880
2 changed files with 21 additions and 5 deletions

View File

@@ -428,10 +428,17 @@ impl JavtifulProvider {
.unwrap_or(0);
let quality = "1080p".to_string();
let stripped_url = crate::providers::strip_url_scheme(url);
let proxy_target = stripped_url
.strip_prefix("www.javtiful.com/")
.or_else(|| stripped_url.strip_prefix("javtiful.com/"))
.unwrap_or(stripped_url.as_str())
.trim_start_matches('/')
.to_string();
let video_url = crate::providers::build_proxy_url(
options,
"javtiful",
&crate::providers::strip_url_scheme(url),
&proxy_target,
);
Ok((
tags,

View File

@@ -17,12 +17,21 @@ impl JavtifulProxy {
requester: web::types::State<Requester>,
) -> String {
let mut requester = requester.get_ref().clone();
let url = "https://javtiful.com/".to_string() + &url;
let text = requester.get(&url, None).await.unwrap_or("".to_string());
let endpoint = url
.trim_start_matches('/')
.strip_prefix("https://")
.or_else(|| url.trim_start_matches('/').strip_prefix("http://"))
.unwrap_or(url.trim_start_matches('/'))
.trim_start_matches("www.javtiful.com/")
.trim_start_matches("javtiful.com/")
.trim_start_matches('/')
.to_string();
let detail_url = format!("https://javtiful.com/{endpoint}");
let text = requester.get(&detail_url, None).await.unwrap_or_default();
if text.is_empty() {
return "".to_string();
}
let video_id = url.split('/').nth(4).unwrap_or("").to_string();
let video_id = endpoint.split('/').nth(1).unwrap_or("").to_string();
let token = text
.split("data-csrf-token=\"")
@@ -39,7 +48,7 @@ impl JavtifulProxy {
.post_multipart(
"https://javtiful.com/ajax/get_cdn",
form,
vec![("Referer".to_string(), url.to_string())],
vec![("Referer".to_string(), detail_url)],
Some(Version::HTTP_11),
)
.await