hanime updates

This commit is contained in:
Simon
2025-10-17 08:19:32 +00:00
parent 09c06df163
commit a0e0a8e4b1
5 changed files with 95 additions and 28 deletions

View File

@@ -10,6 +10,11 @@ pub fn config(cfg: &mut web::ServiceConfig) {
.route(web::post().to(sxyprn))
.route(web::get().to(sxyprn)),
)
.service(
web::resource("/hanime-cdn/{endpoint}*")
.route(web::post().to(crate::proxies::hanimecdn::get_image))
.route(web::get().to(crate::proxies::hanimecdn::get_image)),
)
// .service(
// web::resource("/videos")
// // .route(web::get().to(videos_get))
@@ -23,7 +28,6 @@ async fn sxyprn(req: HttpRequest,
requester: web::types::State<Requester>,) -> Result<impl web::Responder, web::Error> {
let proxy = get_proxy(req.uri().to_string().split("/").collect::<Vec<&str>>()[2]).unwrap();
let endpoint = req.match_info().query("endpoint").to_string();
println!("/proxy/sxyprn: endpoint={:?}", endpoint);
let video_url = match proxy.get_video_url(endpoint, requester).await{
url if url != "" => url,
_ => "Error".to_string(),