tt-help-cli-ycl 1.4.53 → 1.4.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/webserver/server.mjs +4 -3
package/package.json
CHANGED
package/src/webserver/server.mjs
CHANGED
|
@@ -222,14 +222,15 @@ async function handleTiktokProduct(req, res) {
|
|
|
222
222
|
);
|
|
223
223
|
return sendJSON(res, 200, result);
|
|
224
224
|
} catch (e) {
|
|
225
|
-
// 先返回错误,不阻塞请求
|
|
226
225
|
console.error(`[webserver] product FAIL | ${clientIP} | ${e.message}`);
|
|
227
|
-
sendJSON(res, 502, { error: e.message });
|
|
228
226
|
|
|
229
|
-
// 如果是 captcha
|
|
227
|
+
// 如果是 captcha,先触发上报+恢复(不阻塞其他请求)
|
|
228
|
+
// 必须在 sendJSON 之前调用,否则 sendJSON 抛异常会导致验证码通知丢失
|
|
230
229
|
if (e.message?.includes("Blocked by TikTok")) {
|
|
231
230
|
scheduleCaptchaRecovery(normalizedUrl, SCRAPER_CONFIG.proxyServer);
|
|
232
231
|
}
|
|
232
|
+
|
|
233
|
+
sendJSON(res, 502, { error: e.message });
|
|
233
234
|
return;
|
|
234
235
|
}
|
|
235
236
|
}
|