From 3cb5790bdc9a1fe7acb5aa477a9bf049ba973afa Mon Sep 17 00:00:00 2001 From: Vinlic Date: Thu, 9 Jan 2025 18:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=9F=E8=BF=9B=E5=AE=98=E6=96=B9=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E5=8F=8D=E9=80=86=E5=90=91=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 35144cac553a7a2a.wasm | Bin 17599 -> 0 bytes package.json | 2 +- sha3_wasm_bg.7b9ca65ddd.wasm | Bin 0 -> 26612 bytes src/api/controllers/chat.ts | 73 ++++++++++------------------------- 4 files changed, 22 insertions(+), 53 deletions(-) delete mode 100644 35144cac553a7a2a.wasm create mode 100644 sha3_wasm_bg.7b9ca65ddd.wasm diff --git a/35144cac553a7a2a.wasm b/35144cac553a7a2a.wasm deleted file mode 100644 index 23ea1e3e5383192c514204be910e383b6979f675..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17599 zcmbW9TWnp|ncvsGoC|pl#VuL3Y0;Opw`E(jE$Q%jD5v9SpG2}XuIm(Nr+Jepin4Sl zi{c?o%M;h46P>A;WB@<-!9Y`t9t?~NWLggp6viM$IY0^+Xxj0EftiN@HBfir0tV^< zGN=m}Re%4r_BlM1^T-9&$VszDgt1vId z{8mrEcc2f~U|uY#owo1|HI`lNbrUs?mV92!kN1l%l8-@GlBt6Gzo5`voQ{ znJ_48=O8WxmxEfZ6a{8)d59hI&CP97tNbXalwV$Yd8PAOXhvQI(9>(@7p6~7&CZ#T zVP9XlxUpnP51l^!>X{3d&c3vC>GZB{Am z&id(wIdF&8Ni%+j)+uvvC<#m+)P|pY_|YSWA9?JF$J60ozJBy?v#@$Kcq2T%`#)>) zzYkuBk5m5Vo8Nn3q{K(9odx-o)wGnq{m0wpP-wF1iIF&eD6QnimX_0qF~7Nav+_LC zN_p7^d3EEZ%q(x@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)aY;=VmoB}ue!l2gx^&h$p0}JYuOJg>@Hw=|DA!hA=`h7lEM^^= zuxD46*6gK~b^G$d`r>(ec4=+>!X?j`yN5Pd?{3yPLHPt_!n&e&kLKUsq{6=+Zn|RA z=s#mNf8^^L=f2)7+J}7m<_{U9f7g9sXy4Q)Eb2<;`%;axZEgB8D$1}ZePK3-i;rUd zW^cdEVq6c7s$X~0$-vRGOPAMf{ z*Dn0wl70I3tSg_eFJHKHTHJenY2mDSHcrfhG3LEk+5jH@n(6;wXZpgGo$3Ag|AzS^ z<{LwoJ1b{jSw!Ilbv_rDSnllMGp~i^R~Ig#Bg()$ePpUGK|5Uh|9q(J$g$@C1)*X9 AA^-pY diff --git a/package.json b/package.json index b1b694b..21e08fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deepseek-free-api", - "version": "0.0.13", + "version": "0.0.14", "description": "DeepSeek Free API Server", "type": "module", "main": "dist/index.js", diff --git a/sha3_wasm_bg.7b9ca65ddd.wasm b/sha3_wasm_bg.7b9ca65ddd.wasm new file mode 100644 index 0000000000000000000000000000000000000000..ac92b1d87e8cdf3a5c2af4d189743c1f9d5feba7 GIT binary patch literal 26612 zcmeHwdwf+_o$p#}?|sfbujGUV2qeHdr?d@)kOV?b09&)8P$GT#XsxyiDWruH8ps1m zZKoV4QLxqGj5E`ZuR(9eQmq!}I$E__oM~%y)Z)ErJ5C+xOdWgg^`m%4$6l@Fe!su9 z&&i`$KhEDn$XWZhp1<{5zx8{qwNKQ**iBj~r7zEHHv9JJeVe^~k^oThtTt;rX%_h? zVj3{5WvI;wfp1frlk&hKucJLkDdqcK!X%YRV+^A_&o_SPd!A=JrM;v|7^Onv2Pnj+ z-lcQ7z|*QBk-~UUrE)@Ll7FU?iJJy*+BtfQQL}Fbx|_BR4(=Ko930xTZD4HMrahf1 zk(T_iojdjnD!pjarkk(dKD_nD!Qo8O?504LysteDVQe$xM zuAQUfn>y6Ov*dQFbI+2yLN%vmX%*>A_I$If=q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YlcnWUgV!nzift z-+b+LZ^s`1c+dOpN0Z0C{-fu9d^*>#u7B%b<>22u{FO((_tfcM+%a+Iy&wO|BaeOU z$shdFhI_vJt;fIpWdG$?y!kC}-*ouBcYo${pMT`5kALl{hBi}RPa z-}m6>ANksoPyOfvs`oGN>9~8*x1anU-~INP%ddFrwaKtPe?j}tem=ajbkVE()*X4@ z8*kkG#Me)L=jng^$xCOH-BdjABmcl_!)8Cxu>XO&$|r+G;rC+lCI zcDBpq5bLe@t-^1`GxetOl)3|+%=?1P>TTy7RkP;WMOnLf(a)FJr5AP_UApt*o0pkm zr;1FDX)KySbo8K83=>ep+N%!b!%lgcFfO*8t_ zx>TnzVvx~`Q~Cy9C(xCdXM8X3*fvPTmp(nfbI>hwF(zIT2q3rEN#dQgBy;7Mcd@o>i~$-zAHc(2lb4~O(U zdb3rD?MC?;$KO{P$TZ+R&jk7}&HPz8eSSDEqxCYc12Y4P(CV)N*Itqc?fR2U+xowHMA7+PZb9OM1a;G)P2t@O(_J&Ri98l5eo%Vfw1mpV}*CZ3Nb_wGx#}cR{$fVye2dJTscO=j~ zRssCSfwaQ}#c8?Y|z}gt;#_b5-Ca!q6la`tQe^EdGj6*XcQd zu1C)e(rd6)A4QvseC5A{@oq}0&4_Eszp4*$pyJ?nyR@SCqg3Ti2h$#vr~Pq$%H>zy zjY|A?$R!H-6+Xg_lN9Y;%1q=PuDH~TQxm5yQI&N35Vx;X$E(Eks(6I1-->hmw&G9B zv~S&UlXz}z9m`iN?-oa>nguyDFa~c^ywV#6w!=|dV|R^hf5)J`_#!LmQhU?(;Z5`g zw+#+#RVVB6YKcWa)Re#eWWmdCOOq{y&&D>M{TT literal 0 HcmV?d00001 diff --git a/src/api/controllers/chat.ts b/src/api/controllers/chat.ts index 9cb9160..935a152 100644 --- a/src/api/controllers/chat.ts +++ b/src/api/controllers/chat.ts @@ -1,8 +1,6 @@ import { PassThrough } from "stream"; import _ from "lodash"; import axios, { AxiosResponse } from "axios"; -import { Worker } from 'worker_threads'; -import path from 'path'; import APIException from "@/lib/exceptions/APIException.ts"; import EX from "@/api/consts/exceptions.ts"; @@ -14,7 +12,7 @@ import util from "@/lib/util.ts"; // 模型名称 const MODEL_NAME = "deepseek-chat"; // 插冷鸡WASM文件路径 -const WASM_PATH = './35144cac553a7a2a.wasm'; +const WASM_PATH = './sha3_wasm_bg.7b9ca65ddd.wasm'; // access_token有效期 const ACCESS_TOKEN_EXPIRES = 3600; // 最大重试次数 @@ -39,7 +37,7 @@ const FAKE_HEADERS = { "Sec-Fetch-Site": "same-origin", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36", - "X-App-Version": "20241018.0" + "X-App-Version": "20241129.1" }; const EVENT_COMMIT_ID = '41e9c7b1'; // 当前IP地址 @@ -49,27 +47,6 @@ const accessTokenMap = new Map(); // access_token请求队列映射 const accessTokenRequestQueueMap: Record = {}; -// 添加 worker 池 -const workerPool: (Worker & { inUse?: boolean })[] = []; -const MAX_WORKERS = 4; // 可以根据需要调整 - -function getWorker() { - // 从池中获取空闲worker或创建新worker - let worker = workerPool.find(w => !w.inUse); - if (!worker && workerPool.length < MAX_WORKERS) { - worker = new Worker(path.join(path.resolve(), 'challenge-worker.js')); - workerPool.push(worker); - } - if (worker) { - worker.inUse = true; - } - return worker; -} - -function releaseWorker(worker: (Worker & { inUse?: boolean })) { - worker.inUse = false; -} - async function getIPAddress() { if (ipAddress) return ipAddress; const result = await axios.get('https://chat.deepseek.com/', { @@ -202,18 +179,19 @@ async function createSession(model: string, refreshToken: string): Promise { +async function answerChallenge(response: any, targetPath: string): Promise { const { algorithm, challenge, salt, difficulty, expire_at, signature } = response; const deepSeekHash = new DeepSeekHash(); await deepSeekHash.init(WASM_PATH); const answer = deepSeekHash.calculateHash(algorithm, challenge, salt, difficulty, expire_at); - return { + return Buffer.from(JSON.stringify({ algorithm, challenge, salt, answer, - signature - } + signature, + target_path: targetPath + })).toString('base64'); } /** @@ -221,9 +199,11 @@ async function answerChallenge(response: any): Promise { * * @param refreshToken 用于刷新access_token的refresh_token */ -async function getChallengeResponse(refreshToken: string) { +async function getChallengeResponse(refreshToken: string, targetPath: string) { const token = await acquireToken(refreshToken); - const result = await axios.get('https://chat.deepseek.com/api/v0/chat/challenge', { + const result = await axios.post('https://chat.deepseek.com/api/v0/chat/create_pow_challenge', { + target_path: targetPath + }, { headers: { Authorization: `Bearer ${token}`, ...FAKE_HEADERS, @@ -283,19 +263,15 @@ async function createCompletion( } } - let challenge; - if (isSearchModel || isThinkingModel) { - const challengeResponse = await getChallengeResponse(refreshToken); - challenge = await answerChallenge(challengeResponse); - logger.info(`插冷鸡: ${JSON.stringify(challenge)}`); - } + const challengeResponse = await getChallengeResponse(refreshToken, '/api/v0/chat/completion'); + const challenge = await answerChallenge(challengeResponse, '/api/v0/chat/completion'); + logger.info(`插冷鸡: ${challenge}`); const result = await axios.post( "https://chat.deepseek.com/api/v0/chat/completion", { chat_session_id: sessionId, parent_message_id: refParentMsgId || null, - challenge_response: challenge, prompt, ref_file_ids: [], search_enabled: isSearchModel, @@ -305,7 +281,8 @@ async function createCompletion( headers: { Authorization: `Bearer ${token}`, ...FAKE_HEADERS, - Cookie: generateCookie() + Cookie: generateCookie(), + 'X-Ds-Pow-Response': challenge }, // 120秒超时 timeout: 120000, @@ -394,12 +371,9 @@ async function createCompletionStream( } } - let challenge; - if (isSearchModel || isThinkingModel) { - const challengeResponse = await getChallengeResponse(refreshToken); - challenge = await answerChallenge(challengeResponse); - logger.info(`插冷鸡: ${JSON.stringify(challenge)}`); - } + const challengeResponse = await getChallengeResponse(refreshToken, '/api/v0/chat/completion'); + const challenge = await answerChallenge(challengeResponse, '/api/v0/chat/completion'); + logger.info(`插冷鸡: ${challenge}`); // 创建会话 const sessionId = refSessionId || await createSession(model, refreshToken); @@ -412,7 +386,6 @@ async function createCompletionStream( chat_session_id: sessionId, parent_message_id: refParentMsgId || null, prompt, - challenge_response: challenge, ref_file_ids: [], search_enabled: isSearchModel, thinking_enabled: isThinkingModel @@ -421,7 +394,8 @@ async function createCompletionStream( headers: { Authorization: `Bearer ${token}`, ...FAKE_HEADERS, - Cookie: generateCookie() + Cookie: generateCookie(), + 'X-Ds-Pow-Response': challenge }, // 120秒超时 timeout: 120000, @@ -1254,11 +1228,6 @@ getIPAddress().then(() => { logger.error('获取 IP 地址失败:', err); }); -// 在程序退出时清理workers -process.on('exit', () => { - workerPool.forEach(worker => worker.terminate()); -}); - export default { createCompletion, createCompletionStream,