@xiaohhhh1/canvas-agent 0.4.29 → 0.4.31

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.
@@ -14,7 +14,7 @@ const DETAIL_TREND_DAYS = 7;
14
14
  const DETAIL_FETCH_CONCURRENCY = 3;
15
15
  const VIDEO_LEARNING_TARGET = 36;
16
16
  const VIDEO_COMMERCE_TARGET = 12;
17
- const VIDEO_AI_TARGET_PER_DIMENSION = 12;
17
+ const VIDEO_AI_TARGET_PER_DIMENSION = 13;
18
18
  const VIDEO_AI_RANKING_PATH = "/zh/media-source/top-ai-videos";
19
19
  const RANKING_DEFINITIONS = [
20
20
  { source: "new", label: "新品榜", pathname: "/e-commerce/newProducts" },
@@ -353,6 +353,15 @@ export class FastMossIntegration {
353
353
  await this.inspect();
354
354
  if (this.verificationRequired)
355
355
  throw new Error("采集 AI 视频榜时出现滑块验证;请手动完成后重新采集");
356
+ await this.waitForVideoResponseTasks();
357
+ // High Sales is server-rendered on the first load, so there is no
358
+ // ranking JSON response to observe. Moving to page 2 through the
359
+ // visible pager produces the same public ranking data as every
360
+ // subsequent tab and avoids scraping hidden application state.
361
+ if (entryIndex === 0 && this.observedVideoRecords.length === 0 && await this.clickVideoLearningNextPage()) {
362
+ await this.waitForVideoLearningNavigation();
363
+ await this.waitForVideoResponseTasks();
364
+ }
356
365
  const remaining = Math.min(VIDEO_AI_TARGET_PER_DIMENSION, requestedTarget - sources.length);
357
366
  await collect(entry.dimension, remaining);
358
367
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaohhhh1/canvas-agent",
3
- "version": "0.4.29",
3
+ "version": "0.4.31",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",