From 4a0162b54fd578837eb3342abfac35eb87633941 Mon Sep 17 00:00:00 2001 From: TechDecryptor <145176897+TechDecryptor@users.noreply.github.com> Date: Thu, 26 Oct 2023 12:32:18 +0800 Subject: [PATCH] perf: Respond faster --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 627079a..2bcf546 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,7 +31,7 @@ pub fn translate( _needs: HashMap, ) -> Result> { let client = reqwest::blocking::ClientBuilder::new().build()?; - const URL: &str = "https://yi.qq.com/api/imt"; + const URL: &str = "https://transmart.qq.com/api/imt"; let post_data = init_data(from, to, text); @@ -39,7 +39,7 @@ pub fn translate( .post(URL) .header("Content-Type", "application/json") .header("user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36") - .header("referer", "https://yi.qq.com/zh-CN/index") + .header("referer", "https://transmart.qq.com/zh-CN/index") .body(post_data.to_string()) .send()? .json()?;