tt-help-cli-ycl 1.3.35 → 1.3.36
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/README.md +17 -1
- package/package.json +4 -2
- package/scripts/test-watch-db-smoke.mjs +246 -0
- package/src/cli/attach.js +149 -89
- package/src/cli/auto.js +180 -155
- package/src/cli/comments.js +301 -210
- package/src/cli/config.js +61 -43
- package/src/cli/db-import.js +51 -0
- package/src/cli/explore.js +373 -342
- package/src/cli/refresh.js +223 -151
- package/src/cli/videostats.js +140 -25
- package/src/cli/watch.js +15 -16
- package/src/lib/args.js +50 -6
- package/src/lib/constants.js +114 -92
- package/src/lib/tiktok-scraper.mjs +59 -21
- package/src/main.js +42 -20
- package/src/watch/data-store.js +1560 -236
- package/src/watch/public/index.html +51 -15
- package/src/watch/server.js +63 -374
package/src/main.js
CHANGED
|
@@ -1,28 +1,50 @@
|
|
|
1
|
-
import { parseArgs } from
|
|
2
|
-
import { proxy, HELP_TEXT, getConfigText } from
|
|
3
|
-
import { handleInfo } from
|
|
4
|
-
import { handleExplore } from
|
|
5
|
-
import { handleAttach } from
|
|
6
|
-
import { handleWatch } from
|
|
7
|
-
import { handleConfig, showConfig, showUsage, version } from
|
|
8
|
-
import { handleOpen } from
|
|
9
|
-
import { handleComments } from
|
|
10
|
-
import { handleVideoStats } from
|
|
1
|
+
import { parseArgs } from "./lib/args.js";
|
|
2
|
+
import { proxy, HELP_TEXT, getConfigText } from "./lib/constants.js";
|
|
3
|
+
import { handleInfo } from "./cli/info.js";
|
|
4
|
+
import { handleExplore } from "./cli/explore.js";
|
|
5
|
+
import { handleAttach } from "./cli/attach.js";
|
|
6
|
+
import { handleWatch } from "./cli/watch.js";
|
|
7
|
+
import { handleConfig, showConfig, showUsage, version } from "./cli/config.js";
|
|
8
|
+
import { handleOpen } from "./cli/open.js";
|
|
9
|
+
import { handleComments } from "./cli/comments.js";
|
|
10
|
+
import { handleVideoStats } from "./cli/videostats.js";
|
|
11
|
+
import { handleDbImport } from "./cli/db-import.js";
|
|
11
12
|
|
|
12
13
|
async function main() {
|
|
13
14
|
const parsed = parseArgs();
|
|
14
15
|
|
|
15
16
|
switch (parsed.subcommand) {
|
|
16
|
-
case
|
|
17
|
-
|
|
18
|
-
case
|
|
19
|
-
|
|
20
|
-
case
|
|
21
|
-
|
|
22
|
-
case
|
|
17
|
+
case "explore":
|
|
18
|
+
return handleExplore(parsed);
|
|
19
|
+
case "info":
|
|
20
|
+
return handleInfo(parsed);
|
|
21
|
+
case "attach":
|
|
22
|
+
return handleAttach(parsed);
|
|
23
|
+
case "watch":
|
|
24
|
+
return handleWatch(parsed);
|
|
25
|
+
case "open":
|
|
26
|
+
return handleOpen(parsed);
|
|
27
|
+
case "comments":
|
|
28
|
+
return handleComments(parsed);
|
|
29
|
+
case "videostats":
|
|
30
|
+
return handleVideoStats(parsed);
|
|
31
|
+
case "db-import":
|
|
32
|
+
return handleDbImport(parsed);
|
|
23
33
|
}
|
|
24
34
|
|
|
25
|
-
const {
|
|
35
|
+
const {
|
|
36
|
+
urls,
|
|
37
|
+
outputFile,
|
|
38
|
+
outputFormat,
|
|
39
|
+
exploreCount,
|
|
40
|
+
showConfig: showCfg,
|
|
41
|
+
showHelp,
|
|
42
|
+
showVersion,
|
|
43
|
+
customProxy,
|
|
44
|
+
configAction,
|
|
45
|
+
configKey,
|
|
46
|
+
configValue,
|
|
47
|
+
} = parsed;
|
|
26
48
|
|
|
27
49
|
if (showVersion) {
|
|
28
50
|
console.log(version);
|
|
@@ -35,14 +57,14 @@ async function main() {
|
|
|
35
57
|
|
|
36
58
|
// 默认行为:URL 走 info,--explore 走 explore
|
|
37
59
|
if (exploreCount > 0) {
|
|
38
|
-
return handleExplore({ ...parsed, subcommand:
|
|
60
|
+
return handleExplore({ ...parsed, subcommand: "explore" });
|
|
39
61
|
}
|
|
40
62
|
|
|
41
63
|
// 有 URL 默认走 info
|
|
42
64
|
return handleInfo(parsed);
|
|
43
65
|
}
|
|
44
66
|
|
|
45
|
-
main().catch(err => {
|
|
67
|
+
main().catch((err) => {
|
|
46
68
|
console.error(`错误: ${err.message}`);
|
|
47
69
|
process.exit(1);
|
|
48
70
|
});
|