javtiful proxy
This commit is contained in:
@@ -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())],
|
||||
|
||||
Reference in New Issue
Block a user