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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-help-cli-ycl",
3
- "version": "1.3.55",
3
+ "version": "1.3.58",
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/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("可用端口: 9222 - 9231 (共 10 个)");
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 < BASE_PORT || port >= BASE_PORT + TOTAL_ACCOUNTS) {
44
- console.error(`端口 ${openPort} 不在有效范围内 (9222 - 9231)`);
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({ id: item.id, href });
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 = [];