tt-help-cli-ycl 1.3.55 → 1.3.58
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 +1 -1
- package/src/cli/open.js +3 -4
- package/src/lib/api-interceptor.js +6 -2
- package/src/scraper/explore-core.js +12 -0
- package/src/watch/data-store.js +457 -109
- package/src/watch/public/app.js +1266 -0
- package/src/watch/public/index.html +4 -2088
- package/src/watch/public/style.css +1070 -0
- package/src/watch/server.js +64 -3
- package/scripts/run-explore copy.bat +0 -101
- package/scripts/test-captcha-lib.mjs +0 -68
- package/scripts/test-captcha.mjs +0 -81
- package/scripts/test-html-analysis.mjs +0 -128
- package/scripts/test-incognito-lib.mjs +0 -36
- package/scripts/test-login-state.mjs +0 -128
- package/scripts/test-safe-click.mjs +0 -45
- package/scripts/test-watch-db-smoke.mjs +0 -246
package/package.json
CHANGED
package/src/cli/open.js
CHANGED
|
@@ -34,14 +34,13 @@ export async function handleOpen(parsed) {
|
|
|
34
34
|
console.error("用法: tt-help open <端口>");
|
|
35
35
|
console.error("示例: tt-help open 9222");
|
|
36
36
|
console.error("");
|
|
37
|
-
console.error("
|
|
38
|
-
console.error('运行 "tt-help open --list" 查看所有配置');
|
|
37
|
+
console.error('运行 "tt-help open --list" 查看内置浏览器配置');
|
|
39
38
|
process.exit(1);
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
const port = parseInt(openPort);
|
|
43
|
-
if (isNaN(port) || port <
|
|
44
|
-
console.error(`端口 ${openPort}
|
|
42
|
+
if (isNaN(port) || port < 1 || port > 65535) {
|
|
43
|
+
console.error(`端口 ${openPort} 无效 (请使用 1 - 65535)`);
|
|
45
44
|
process.exit(1);
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -18,7 +18,7 @@ async function processAPIResponse(
|
|
|
18
18
|
for (const item of firstPageItems) {
|
|
19
19
|
if (items.length >= maxVideos) break;
|
|
20
20
|
const href = `https://www.tiktok.com/@${username}/video/${item.id}`;
|
|
21
|
-
items.push({ id: item.id, href });
|
|
21
|
+
items.push({ id: item.id, href, createTime: item.createTime || null });
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
let cursor = data.cursor;
|
|
@@ -59,7 +59,11 @@ async function processAPIResponse(
|
|
|
59
59
|
for (const item of pageData.itemList) {
|
|
60
60
|
if (items.length >= maxVideos) break;
|
|
61
61
|
const href = `https://www.tiktok.com/@${username}/video/${item.id}`;
|
|
62
|
-
items.push({
|
|
62
|
+
items.push({
|
|
63
|
+
id: item.id,
|
|
64
|
+
href,
|
|
65
|
+
createTime: item.createTime || null,
|
|
66
|
+
});
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
69
|
|
|
@@ -37,7 +37,9 @@ async function processExplore(page, username, options, log) {
|
|
|
37
37
|
hasFollowData: false,
|
|
38
38
|
keepFollow: false,
|
|
39
39
|
locationCreated: null,
|
|
40
|
+
latestVideoTime: null,
|
|
40
41
|
noVideo: false,
|
|
42
|
+
restricted: false,
|
|
41
43
|
error: null,
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -66,6 +68,15 @@ async function processExplore(page, username, options, log) {
|
|
|
66
68
|
const videoArray = videoList ? [...videoList.values()] : [];
|
|
67
69
|
result.collectedVideos = videoArray.length;
|
|
68
70
|
|
|
71
|
+
// 从视频列表中找最近的作品发布时间
|
|
72
|
+
const latestCreateTime = videoArray
|
|
73
|
+
.filter((v) => v.createTime)
|
|
74
|
+
.reduce((max, v) => (v.createTime > max ? v.createTime : max), 0);
|
|
75
|
+
if (latestCreateTime > 0) {
|
|
76
|
+
result.latestVideoTime = latestCreateTime;
|
|
77
|
+
if (result.userInfo) result.userInfo.latestVideoTime = latestCreateTime;
|
|
78
|
+
}
|
|
79
|
+
|
|
69
80
|
if (videoArray.length <= 0) {
|
|
70
81
|
// 视频为空:可能是页面受限或用户真的没有视频
|
|
71
82
|
result.processed = true;
|
|
@@ -172,6 +183,7 @@ async function processExplore(page, username, options, log) {
|
|
|
172
183
|
result.videoList = videoArray;
|
|
173
184
|
} else {
|
|
174
185
|
// 国家不匹配
|
|
186
|
+
result.restricted = true;
|
|
175
187
|
result.keepFollow = false;
|
|
176
188
|
result.discoveredFollowing = [];
|
|
177
189
|
result.discoveredFollowers = [];
|