tt-help-cli-ycl 1.4.91 → 1.4.92
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 +2 -2
- package/src/cli/explore.js +4 -0
- package/src/cli/refresh.js +4 -0
- package/src/lib/args.js +8 -0
- package/src/scraper/explore-core.js +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tt-help-cli-ycl",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.92",
|
|
4
4
|
"description": "TikTok user & video data scraper - extract ttSeller, verified, locationCreated from HTML source",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"better-sqlite3": "^12.10.0"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
package/src/cli/explore.js
CHANGED
|
@@ -72,6 +72,7 @@ export async function handleExplore(options) {
|
|
|
72
72
|
exploreMaxVideos,
|
|
73
73
|
exploreProxy,
|
|
74
74
|
exploreWebserver,
|
|
75
|
+
exploreNoProduct,
|
|
75
76
|
} = options;
|
|
76
77
|
|
|
77
78
|
let userId = exploreUserId || configuredUserId;
|
|
@@ -472,6 +473,7 @@ export async function handleExplore(options) {
|
|
|
472
473
|
location: exploreLocation,
|
|
473
474
|
proxyServer: cdpOptions.proxyServer || null,
|
|
474
475
|
webserverUrl: exploreWebserver || null,
|
|
476
|
+
noProduct: !!exploreNoProduct,
|
|
475
477
|
},
|
|
476
478
|
console.error,
|
|
477
479
|
);
|
|
@@ -498,6 +500,7 @@ export async function handleExplore(options) {
|
|
|
498
500
|
location: exploreLocation,
|
|
499
501
|
proxyServer: cdpOptions.proxyServer || null,
|
|
500
502
|
webserverUrl: exploreWebserver || null,
|
|
503
|
+
noProduct: !!exploreNoProduct,
|
|
501
504
|
browser,
|
|
502
505
|
},
|
|
503
506
|
console.error,
|
|
@@ -546,6 +549,7 @@ export async function handleExplore(options) {
|
|
|
546
549
|
location: exploreLocation,
|
|
547
550
|
proxyServer: cdpOptions.proxyServer || null,
|
|
548
551
|
webserverUrl: exploreWebserver || null,
|
|
552
|
+
noProduct: !!exploreNoProduct,
|
|
549
553
|
browser,
|
|
550
554
|
},
|
|
551
555
|
console.error,
|
package/src/cli/refresh.js
CHANGED
|
@@ -70,6 +70,7 @@ export async function handleRefresh(options) {
|
|
|
70
70
|
exploreRedoMaxAge,
|
|
71
71
|
exploreProxy,
|
|
72
72
|
exploreWebserver,
|
|
73
|
+
exploreNoProduct,
|
|
73
74
|
} = options;
|
|
74
75
|
const effectiveProxy = exploreProxy || configuredProxy;
|
|
75
76
|
let resolvedProxy = effectiveProxy;
|
|
@@ -489,6 +490,7 @@ export async function handleRefresh(options) {
|
|
|
489
490
|
browser,
|
|
490
491
|
proxyServer: cdpOptions.proxyServer || null,
|
|
491
492
|
webserverUrl: exploreWebserver || null,
|
|
493
|
+
noProduct: !!exploreNoProduct,
|
|
492
494
|
},
|
|
493
495
|
console.error,
|
|
494
496
|
);
|
|
@@ -516,6 +518,7 @@ export async function handleRefresh(options) {
|
|
|
516
518
|
browser,
|
|
517
519
|
proxyServer: cdpOptions.proxyServer || null,
|
|
518
520
|
webserverUrl: exploreWebserver || null,
|
|
521
|
+
noProduct: !!exploreNoProduct,
|
|
519
522
|
},
|
|
520
523
|
console.error,
|
|
521
524
|
);
|
|
@@ -565,6 +568,7 @@ export async function handleRefresh(options) {
|
|
|
565
568
|
browser,
|
|
566
569
|
proxyServer: cdpOptions.proxyServer || null,
|
|
567
570
|
webserverUrl: exploreWebserver || null,
|
|
571
|
+
noProduct: !!exploreNoProduct,
|
|
568
572
|
},
|
|
569
573
|
console.error,
|
|
570
574
|
);
|
package/src/lib/args.js
CHANGED
|
@@ -182,6 +182,7 @@ function parseExploreArgs(args) {
|
|
|
182
182
|
let exploreMaxVideos = 16;
|
|
183
183
|
let exploreProxy = null;
|
|
184
184
|
let exploreWebserver = null;
|
|
185
|
+
let exploreNoProduct = false;
|
|
185
186
|
|
|
186
187
|
const positional = [];
|
|
187
188
|
const PRESETS = ["fast", "normal", "slow", "stealth"];
|
|
@@ -224,6 +225,8 @@ function parseExploreArgs(args) {
|
|
|
224
225
|
exploreProxy = args[++i];
|
|
225
226
|
} else if (arg === "--webserver") {
|
|
226
227
|
exploreWebserver = args[++i];
|
|
228
|
+
} else if (arg === "--no-product") {
|
|
229
|
+
exploreNoProduct = true;
|
|
227
230
|
} else {
|
|
228
231
|
positional.push(arg);
|
|
229
232
|
}
|
|
@@ -266,6 +269,7 @@ function parseExploreArgs(args) {
|
|
|
266
269
|
exploreMaxVideos,
|
|
267
270
|
exploreProxy,
|
|
268
271
|
exploreWebserver,
|
|
272
|
+
exploreNoProduct,
|
|
269
273
|
urls: [],
|
|
270
274
|
outputFormat: "json",
|
|
271
275
|
exploreCount: 0,
|
|
@@ -510,6 +514,7 @@ function parseRefreshArgs(args) {
|
|
|
510
514
|
let exploreProxy = null;
|
|
511
515
|
let exploreJobLocations = null;
|
|
512
516
|
let exploreWebserver = null;
|
|
517
|
+
let exploreNoProduct = false;
|
|
513
518
|
|
|
514
519
|
for (let i = 0; i < args.length; i++) {
|
|
515
520
|
const arg = args[i];
|
|
@@ -541,6 +546,8 @@ function parseRefreshArgs(args) {
|
|
|
541
546
|
exploreProxy = args[++i];
|
|
542
547
|
} else if (arg === "--webserver") {
|
|
543
548
|
exploreWebserver = args[++i];
|
|
549
|
+
} else if (arg === "--no-product") {
|
|
550
|
+
exploreNoProduct = true;
|
|
544
551
|
} else if (arg === "--location") {
|
|
545
552
|
exploreLocation = args[++i];
|
|
546
553
|
} else if (arg === "--job-locations") {
|
|
@@ -573,6 +580,7 @@ function parseRefreshArgs(args) {
|
|
|
573
580
|
exploreRedoMaxAge,
|
|
574
581
|
exploreProxy,
|
|
575
582
|
exploreWebserver,
|
|
583
|
+
exploreNoProduct,
|
|
576
584
|
serverUrl,
|
|
577
585
|
urls: [],
|
|
578
586
|
outputFormat: "json",
|
|
@@ -27,6 +27,7 @@ async function processExplore(page, username, options, log) {
|
|
|
27
27
|
locationMode = "explore", // "explore" | "refresh"
|
|
28
28
|
proxyServer = null,
|
|
29
29
|
webserverUrl = null,
|
|
30
|
+
noProduct = false,
|
|
30
31
|
} = options;
|
|
31
32
|
|
|
32
33
|
const result = {
|
|
@@ -130,8 +131,9 @@ async function processExplore(page, username, options, log) {
|
|
|
130
131
|
seoUrl: topVideo.seoUrl || null,
|
|
131
132
|
};
|
|
132
133
|
|
|
133
|
-
//
|
|
134
|
-
|
|
134
|
+
// 如果有商品链接且未禁用,通过 WebService API 抓取商品详情页(评分、销量等)
|
|
135
|
+
// --no-product 时跳过(由独立商品程序异步补抓,避免阻塞 explore/refresh 主流程)
|
|
136
|
+
if (topVideo.seoUrl && options.webserverUrl && !noProduct) {
|
|
135
137
|
try {
|
|
136
138
|
const resp = await fetch(
|
|
137
139
|
`${options.webserverUrl}/api/tiktok/product`,
|