tt-help-cli-ycl 1.4.0 → 1.4.1

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.0",
3
+ "version": "1.4.1",
4
4
  "description": "TikTok user & video data scraper - extract ttSeller, verified, locationCreated from HTML source",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli/tag.js CHANGED
@@ -629,10 +629,8 @@ export async function handleScoreAll(parsed) {
629
629
 
630
630
  await setupPageRequestBlocking(page);
631
631
 
632
- const portPoolStart = Math.max(
633
- 1,
634
- parseInt(process.env.TAG_SCOREALL_PORT_POOL_START || "7222", 10) || 7222,
635
- );
632
+ // 端口池起始以 CLI --port / 环境变量 / 默认 7222 为准
633
+ const portPoolStart = cdpPort;
636
634
  const portPoolSize = Math.max(
637
635
  2,
638
636
  parseInt(process.env.TAG_SCOREALL_PORT_POOL_SIZE || "10", 10) || 10,
@@ -987,7 +985,9 @@ export async function handleScoreAll(parsed) {
987
985
 
988
986
  if (is403) {
989
987
  consecutive403++;
990
- log(` 🚫 HTTP 403 — 连续 ${consecutive403}/${CONSECUTIVE_403_BLOCKED} 次`);
988
+ log(
989
+ ` 🚫 HTTP 403 — 连续 ${consecutive403}/${CONSECUTIVE_403_BLOCKED} 次`,
990
+ );
991
991
  } else {
992
992
  consecutive403 = 0;
993
993
  }
@@ -995,8 +995,7 @@ export async function handleScoreAll(parsed) {
995
995
  log(` ❌ 失败: ${e.message}`);
996
996
  try {
997
997
  // 使用当前正在处理的 tag(tag 变量在 try 块开头已赋值,catch 中仍可访问)
998
- const failedTag =
999
- typeof tag === "string" && tag ? tag : "unknown";
998
+ const failedTag = typeof tag === "string" && tag ? tag : "unknown";
1000
999
  await reportToServer(
1001
1000
  baseUrl,
1002
1001
  {
@@ -260,8 +260,17 @@ const HELP_TEXT = [
260
260
  " 选项:",
261
261
  " --countries <CSV> 目标国家,逗号分隔(默认 13 个欧洲国家)",
262
262
  " -s, --server <URL> 服务端地址(默认 http://127.0.0.1:3000)",
263
+ " --port <N> 起始 CDP 端口,端口池默认为 N~N+9(默认 7222)",
264
+ " --discover 开启自动发现:连续 3 轮无新标签时自动生成",
265
+ " 行为:",
266
+ " 连续 3 次 HTTP 403 → 判断账号被封 → 等 2 分钟后自动切换到池中另一端口",
267
+ " 环境变量:",
268
+ " TAG_SCOREALL_PORT_POOL_SIZE=N 端口池大小(默认 10)",
269
+ " TAG_SCOREALL_RECYCLE_RSS_MB=N 内存回收阈值 RSS MB(默认 900)",
270
+ " TAG_SCOREALL_RECYCLE_HEAP_MB=N 内存回收阈值 Heap MB(默认 320)",
263
271
  " 示例: tt-help tag score-all",
264
272
  " tt-help tag score-all --countries ES -s http://127.0.0.1:3001",
273
+ " tt-help tag score-all --port 9222 -s http://127.0.0.1:3001 --discover",
265
274
  "",
266
275
  " config [show|set|unset|reset]",
267
276
  " config 查看当前配置",