const a = s.alloc(16, T(t)) , n = s.alloc(16, T(o)) , r = i.createDecipheriv("aes-128-cbc", a, n); let l = r.update(e, "base64", "utf-8"); return l += r.final("utf-8"),
var t = "ydsecret://query/key/B*RGygVywfNBwpmBaZg*WT7SIOUP2T0C9WHMZN39j^DAdaZhAnxvGcCY6VYFwnHl" var o = "ydsecret://query/iv/C@lZe2YzHtZ2CYgaXKSVfsb7Y4QWHjITPPZ0nQp87fBeJ!Iv6v^6fvi2WN@bYpJ4" var e = "Z21kD9ZK1ke6ugku2ccWu4n6eLnvoDT0YgGi0y3g-v0B9sYqg8L9D6UERNozYOHq0tIY5zg2_G3Njo5Qsw98fEghPM5cT9RqLsGBQW5jSVzv635HhMVrRZ6XpfYk0jtdgCf21MHrt_Gv94m_MLKUmBr8wSktKe6dvgvAHa5JFYxZjBINiTLwCUM5uFfL230YCw4OOj_f5cgK75GSOgS76xYGS0AcczPyGKkqErEunfjU5J0ztwhHESgwX6aE1qleQphl7R8HfR51CDtqzeL9XhzMjPgetz6gBaXdjYYC00T_ELg1AFx4dqu1N9BZ2wxHxKZ4StKqRDTZcVX5XU13ffSHHnhGva7SKIUpOZgtbz8950OQ92Gm9VkHLeKyWXCtNhms9O8gbr88hXT1oHrLqSduzlKgqHq_LnjsvTOraZRSVuiugeaWVgh2iF-CPnFPsgp2CjeQ9gEgBXwbkn1iDg0uFGRmT_h6mO3mzoaamxNMKWjNlHqXeRNQtsiKwpUCN-VE0IFe5zSKeYN_6y5MVH5zehnMjHbBd-K0f9ESoM-9a5-PDPMUqXxS5dB5gCAh" functionT(o : string){ returncreateHash('md5').update(o).digest(); } console.log(T(o).toJSON().data) const a = Buffer.from(T(t).toJSON().data) const n = Buffer.from(T(o).toJSON().data) const r = createDecipheriv('aes-128-cbc', a, n); let l = r.update(e, 'base64', 'utf-8'); l += r.final('utf-8'); console.log(a,n) console.log(l)
exportasyncfunctionget_translation_result(target: string) { const v : any = awaitget_sign() var aeskey : string = v["aesKey"] var aesiv : string = v["aesIv"] var url : string = "https://dict.youdao.com/webtranslate" var mysticTime : number = Math.floor(Date.now()) varsign: string =createHash('md5').update(`client=fanyideskweb&mysticTime=${mysticTime}&product=webfanyi&key=fsdsogkndfokasodnaso`).digest("hex") var m : string = `i=${target}&from=auto&to=&useTerm=false&dictResult=true&keyid=webfanyi&sign=${sign}&client=fanyideskweb&product=webfanyi&appVersion=1.0.0&vendor=web&pointParam=client%2CmysticTime%2Cproduct&mysticTime=${mysticTime}&keyfrom=fanyi.web&mid=1&screen=1&model=1&network=wifi&abtest=0&yduuid=abcdefg` var header : any = { method : "POST", headers : { "Content-type": "application/x-www-form-urlencoded", "User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36", "Referer": "https://fanyi.youdao.com/", "Cookie": "OUTFOX_SEARCH_USER_ID=11560287@1.1.1.1; OUTFOX_SEARCH_USER_ID_NCOO=1; " }, body: m } const resp = awaitfetch(url, header) const resp_text = await resp.text() const a = Buffer.from(T(aeskey).toJSON().data) const n = Buffer.from(T(aesiv).toJSON().data) const r = createDecipheriv('aes-128-cbc', a, n); let l = r.update(resp_text, 'base64', 'utf-8'); l += r.final('utf-8'); var t = JSON.parse(l) var ans : string = "" for (let index = 0; index < t["translateResult"].length; index++) { ans+=t["translateResult"][index][0]["tgt"] } console.log(ans) }