mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-01-12 08:12:36 +08:00
Remove reqwest
It uses too many dependencies
This commit is contained in:
@@ -38,10 +38,9 @@ async fn maintenance(_req: HttpRequest) -> HttpResponse {
|
||||
.body(r#"{"opened_at":"2024-02-05 02:00:00","closed_at":"2024-02-05 04:00:00","message":":(","server":1,"gamelib":0}"#)
|
||||
}
|
||||
fn handle_assets(req: HttpRequest) -> HttpResponse {
|
||||
let file_name: String = req.match_info().get("file").unwrap().parse().unwrap();
|
||||
HttpResponse::SeeOther()
|
||||
.insert_header(("location", format!("https://sif2.sif.moe{}", req.path())))
|
||||
.body("")
|
||||
.insert_header(("location", format!("https://sif2.sif.moe{}", req.path())))
|
||||
.body("")
|
||||
}
|
||||
#[get("/Android/{hash}/{file}")]
|
||||
async fn files_jp(req: HttpRequest) -> HttpResponse {
|
||||
|
||||
@@ -331,10 +331,12 @@ async fn npps4_req(sha_id: String) -> Option<JsonValue> {
|
||||
let url = format!("{}/ewexport?sha1={}", host, sha_id);
|
||||
println!("Polling NPPS4 at {}", host);
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let response = client.get(url);
|
||||
let response_body = response.send().await.ok()?.text().await.ok()?;
|
||||
json::parse(&response_body).ok()
|
||||
let body = ureq::get(&url)
|
||||
.call().ok()?
|
||||
.body_mut()
|
||||
.read_to_string().ok()?;
|
||||
|
||||
json::parse(&body).ok()
|
||||
}
|
||||
|
||||
fn clean_sif_data(current: &JsonValue) -> JsonValue {
|
||||
|
||||
Reference in New Issue
Block a user