Skip to content

v1.4.8@alpha

Choose a tag to compare

@TriDefender TriDefender released this 21 Jun 11:22
7fc2bd9

感谢@yurchik228336@Wraient的PR #4 和PR #5 ,目前相较1.4.7.alpha修了:

失败点①:CDN 依赖 → 本地 SDK

  • 模块加载时 readFileSync(HERE/AliyunCaptcha.js) 读入仓库里已有但未接线的 224KB SDK(commit 55c3f2d 加进来却没用上)
  • jsdom HTML 用 inline <script>${sdkSafe}</script> 替代 <script src="https://o.alicdn.com/...">
  • </script> 转义防字符串字面量截断
  • 副作用:文件缺失会启动即失败(fail-fast,比运行时 503 好)
    失败点②:0 重试 + 短超时 → 3 重试 + 长超时
  • 新增 solveInJsdomWithRetry 包装器,默认 3 次重试
  • 超时常量全部 env-overridable:ZCODE_CAPTCHA_RETRIES=3 / ZCODE_CAPTCHA_TIMEOUT_MS=40000 / ZCODE_CAPTCHA_SDK_LOAD_MS=20000
  • SDK 加载超时 15s → 20s;solve 超时 30s → 40s
  • finally { w.close() } 释放 jsdom timers/listeners,避免重试间内存泄漏
    失败点③:getInstance 静默吞错 → 显式 reject
  • 替换 (inst.startTracelessVerification || inst.show)?.call(inst) + try {} catch {}
  • 改成显式 typeof fn !== "function" 检查 → reject(...)(不再用 ?. 静默跳过)
  • fn.call(inst) 抛错 → reject(...)(不再用 catch {} 吞掉)
  • 效果:getInstance 出错时立即 reject,外层 40s 超时不再空等

并且借到了账号,实测start-plan有效

The support is still experimental but since the tests works with actual accounts it's considered release ready.