tt-help-cli-ycl 1.4.119 → 1.4.120

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.119",
3
+ "version": "1.4.120",
4
4
  "description": "TikTok user & video data scraper - extract ttSeller, verified, locationCreated from HTML source",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,7 +27,6 @@ import { showResourceUsage } from "../utils/index.js";
27
27
  import { HealthChecker } from "../lib/browser/health-checker.js";
28
28
  import { createApiClient } from "../lib/api-client.js";
29
29
  import { createCDNHandler } from "../lib/cdn-handler.js";
30
- import { requireClashOrExit } from "../clash/checker.js";
31
30
  import path from "path";
32
31
  import os from "os";
33
32
 
@@ -141,24 +140,17 @@ export async function handleExplore(options) {
141
140
  cdpOptions.userDataDir = currentAccount.userDataDir;
142
141
  }
143
142
 
144
- const effectiveProxy = exploreProxy || configuredProxy;
145
- if (effectiveProxy) {
146
- // 如果配置了本地代理,自动发现端口并确保 Clash 可用
147
- if (
148
- effectiveProxy.includes("127.0.0.1") ||
149
- effectiveProxy.includes("localhost")
150
- ) {
151
- const detected = await requireClashOrExit("Explore");
152
- cdpOptions.proxyServer = detected;
153
- console.error(`代理: ${detected} (自动发现)`);
154
- } else {
155
- cdpOptions.proxyServer = effectiveProxy;
156
- console.error(
157
- `代理: ${effectiveProxy}${exploreProxy ? " (命令行指定)" : " (配置文件)"}`,
158
- );
159
- }
143
+ // 配置了什么代理就用什么代理(--proxy > ~/.tt-help.json 的 proxy);
144
+ // 未配置则不注入 proxyServer,浏览器走系统默认代理。
145
+ // 本地地址不再自动解析/强制 requireClashOrExit(与 refresh-mini 一致)。
146
+ const resolvedProxy = exploreProxy || configuredProxy || null;
147
+ if (resolvedProxy) {
148
+ cdpOptions.proxyServer = resolvedProxy;
149
+ console.error(
150
+ `代理: ${resolvedProxy}${exploreProxy ? " (命令行指定)" : " (配置文件)"}`,
151
+ );
160
152
  } else {
161
- console.error(`代理: 未配置`);
153
+ console.error(`代理: 未配置(浏览器走系统默认代理)`);
162
154
  }
163
155
 
164
156
  console.error(`CDP 端口: ${cdpOptions.port}, 用户编号: ${userId}`);
@@ -26,7 +26,6 @@ import {
26
26
  import { HealthChecker } from "../lib/browser/health-checker.js";
27
27
  import { createApiClient } from "../lib/api-client.js";
28
28
  import { createCDNHandler } from "../lib/cdn-handler.js";
29
- import { requireClashOrExit } from "../clash/checker.js";
30
29
  import path from "path";
31
30
  import os from "os";
32
31
 
@@ -77,15 +76,10 @@ export async function handleRefresh(options) {
77
76
  // 跳过用户信息、国家采样、关注/粉丝提取(最大耗时项)和商品详情抓取(由独立商品程序异步补抓),大幅提速。
78
77
  const followEnabled = !exploreMini && exploreEnableFollow !== false;
79
78
  const skipProduct = exploreMini || !!exploreNoProduct;
79
+ // 配置了什么代理就用什么代理(--proxy > ~/.tt-help.json 的 proxy);
80
+ // 未配置则不注入 proxyServer,浏览器走系统默认代理。
80
81
  const effectiveProxy = exploreProxy || configuredProxy;
81
- let resolvedProxy = effectiveProxy;
82
- if (
83
- effectiveProxy &&
84
- (effectiveProxy.includes("127.0.0.1") ||
85
- effectiveProxy.includes("localhost"))
86
- ) {
87
- resolvedProxy = await requireClashOrExit("Refresh");
88
- }
82
+ const resolvedProxy = effectiveProxy || null;
89
83
 
90
84
  let userId = exploreUserId || configuredUserId;
91
85
  let browser = null;
@@ -138,7 +132,7 @@ export async function handleRefresh(options) {
138
132
  console.error(`空闲间隔: ${exploreInterval || 30} 秒`);
139
133
  if (resolvedProxy) {
140
134
  console.error(
141
- `代理: ${resolvedProxy}${effectiveProxy !== resolvedProxy ? " (自动发现)" : exploreProxy ? " (命令行指定)" : " (配置文件)"}`,
135
+ `代理: ${resolvedProxy}${exploreProxy ? " (命令行指定)" : " (配置文件)"}`,
142
136
  );
143
137
  }
144
138
  if (exploreMaxUsers > 0) console.error(`上限: ${exploreMaxUsers} 个用户`);
package/src/cli/search.js CHANGED
@@ -40,7 +40,6 @@ import {
40
40
  } from "../scraper/modules/captcha-handler.js";
41
41
  import { createApiClient } from "../lib/api-client.js";
42
42
  import { HealthChecker } from "../lib/browser/health-checker.js";
43
- import { requireClashOrExit } from "../clash/checker.js";
44
43
  import {
45
44
  server as cfgServer,
46
45
  proxy as configuredProxy,
@@ -80,15 +79,9 @@ export async function handleSearch(parsed) {
80
79
  proxy: cliProxy,
81
80
  } = searchOpts || {};
82
81
 
83
- const effectiveProxy = cliProxy || configuredProxy;
84
- let resolvedProxy = effectiveProxy;
85
- if (
86
- effectiveProxy &&
87
- (effectiveProxy.includes("127.0.0.1") ||
88
- effectiveProxy.includes("localhost"))
89
- ) {
90
- resolvedProxy = await requireClashOrExit("Search");
91
- }
82
+ // 配置了什么代理就用什么代理(--proxy > ~/.tt-help.json 的 proxy);
83
+ // 未配置则不注入 proxyServer,浏览器走系统默认代理。
84
+ const resolvedProxy = cliProxy || configuredProxy || null;
92
85
 
93
86
  const log = (...args) => process.stderr.write(args.join(" ") + "\n");
94
87