mirror of
https://github.com/mrfluffy-dev/kami.git
synced 2026-01-17 04:50:32 +00:00
fixed anime provider
This commit is contained in:
@@ -85,18 +85,28 @@ pub fn anime_link(title: &str, ep: u64) -> (String, String) {
|
|||||||
Some(cap) => cap.get(1).unwrap().as_str().trim().to_string(),
|
Some(cap) => cap.get(1).unwrap().as_str().trim().to_string(),
|
||||||
None => "".to_string(),
|
None => "".to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if id1 != "" {
|
if id1 != "" {
|
||||||
let title = format!("{} Episode {}", title.replace('-', " "), ep);
|
let title = format!("{} Episode {}", title.replace('-', " "), ep);
|
||||||
let encoded_id1 = encode(&id1);
|
let encoded_id1 = encode(&id1);
|
||||||
let anime_id = encode(format!("{}LTXs3GrU8we9O{}", id1, encoded_id1));
|
let encoded_id2 = encode(&encoded_id1);
|
||||||
let html = format!("https://animixplay.to/api/live{}", anime_id);
|
let mut last_byte = encoded_id1.as_bytes()[encoded_id1.len() - 2];
|
||||||
let url = get_ep_location(&html);
|
last_byte += 1;
|
||||||
let url = url.split('#').nth(1).unwrap();
|
let mut new_encoded_id1 = encoded_id1.as_bytes().to_vec();
|
||||||
let url = std::str::from_utf8(&decode(url).unwrap())
|
new_encoded_id1.pop();
|
||||||
.unwrap()
|
new_encoded_id1.pop();
|
||||||
.to_string();
|
new_encoded_id1.push(last_byte);
|
||||||
return (url, title);
|
let new_encoded_id1 = String::from_utf8(new_encoded_id1).unwrap();
|
||||||
|
let ani_id = format!("cW9{}MVFhzM0dyVTh3ZTlP{}", new_encoded_id1, encoded_id2);
|
||||||
|
let result = get_ep_location(format!("https://animixplay.to/api/{}", ani_id).as_str());
|
||||||
|
//split the result into at # and return the second part
|
||||||
|
let result: String = std::str::from_utf8(
|
||||||
|
decode(result.split('#').nth(1).unwrap())
|
||||||
|
.unwrap()
|
||||||
|
.as_slice(),
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
.to_string();
|
||||||
|
return (result, title);
|
||||||
} else {
|
} else {
|
||||||
let re = Regex::new(r#"(?m)r\.html#(.*)""#).unwrap();
|
let re = Regex::new(r#"(?m)r\.html#(.*)""#).unwrap();
|
||||||
let id2 = re
|
let id2 = re
|
||||||
|
|||||||
Reference in New Issue
Block a user