javtiful fix
This commit is contained in:
@@ -428,10 +428,17 @@ impl JavtifulProvider {
|
|||||||
.unwrap_or(0);
|
.unwrap_or(0);
|
||||||
|
|
||||||
let quality = "1080p".to_string();
|
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(
|
let video_url = crate::providers::build_proxy_url(
|
||||||
options,
|
options,
|
||||||
"javtiful",
|
"javtiful",
|
||||||
&crate::providers::strip_url_scheme(url),
|
&proxy_target,
|
||||||
);
|
);
|
||||||
Ok((
|
Ok((
|
||||||
tags,
|
tags,
|
||||||
|
|||||||
@@ -17,12 +17,21 @@ impl JavtifulProxy {
|
|||||||
requester: web::types::State<Requester>,
|
requester: web::types::State<Requester>,
|
||||||
) -> String {
|
) -> String {
|
||||||
let mut requester = requester.get_ref().clone();
|
let mut requester = requester.get_ref().clone();
|
||||||
let url = "https://javtiful.com/".to_string() + &url;
|
let endpoint = url
|
||||||
let text = requester.get(&url, None).await.unwrap_or("".to_string());
|
.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() {
|
if text.is_empty() {
|
||||||
return "".to_string();
|
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
|
let token = text
|
||||||
.split("data-csrf-token=\"")
|
.split("data-csrf-token=\"")
|
||||||
@@ -39,7 +48,7 @@ impl JavtifulProxy {
|
|||||||
.post_multipart(
|
.post_multipart(
|
||||||
"https://javtiful.com/ajax/get_cdn",
|
"https://javtiful.com/ajax/get_cdn",
|
||||||
form,
|
form,
|
||||||
vec![("Referer".to_string(), url.to_string())],
|
vec![("Referer".to_string(), detail_url)],
|
||||||
Some(Version::HTTP_11),
|
Some(Version::HTTP_11),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user