javtiful proxy

This commit is contained in:
Simon
2026-01-07 14:24:18 +00:00
parent 6fac9d6d45
commit cf04441a69
4 changed files with 79 additions and 39 deletions

View File

@@ -366,36 +366,7 @@ impl JavtifulProvider {
.unwrap_or(0);
let quality="1080p".to_string();
let video_id = url
.split('/')
.nth(4)
.ok_or_else(|| ErrorKind::Parse("video id for media".into()))?
.to_string();
let token = text.split("data-csrf-token=\"")
.nth(1)
.and_then(|s| s.split('"').next())
.ok_or_else(|| ErrorKind::Parse("csrf token".into()))?
.to_string();
let form = wreq::multipart::Form::new()
.text("video_id", video_id.clone())
.text("pid_c", "".to_string())
.text("token", token.clone());
let resp = requester
.post_multipart(
"https://javtiful.com/ajax/get_cdn",
form,
vec![("Referer".to_string(), url.to_string())],
Some(Version::HTTP_11),
)
.await
.map_err(|e| Error::from(format!("{}", e)))?;
let text = resp.text().await?;
let json: serde_json::Value = serde_json::from_str(&text)?;
let video_url = json.get("playlists")
.ok_or_else(|| ErrorKind::Parse("video_url in json".into()))?
.to_string().replace("\"", "");
let video_url = url.replace("javtiful.com","hottub.spacemoehre.de/proxy/javtiful");
Ok((
tags,
vec![VideoFormat::new(video_url, quality, "video/mp4".into())],