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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-help-cli-ycl",
3
- "version": "1.4.53",
3
+ "version": "1.4.54",
4
4
  "description": "TikTok user & video data scraper - extract ttSeller, verified, locationCreated from HTML source",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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
  }