video-pipeline 1.2.3 → 1.2.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.5] - 2026-06-11
4
+
5
+ ### Features
6
+
7
+ - 新增 --offset / --limit 参数,支持跳过和限量处理 Excel 数据 (`d691822`)
8
+
9
+ ### Bug Fixes
10
+
11
+ - base_dir 改用 cwd 而非脚本安装目录,修复全局安装后路径解析错误 (`0fe5b1e`)
12
+
13
+ ### Documentation
14
+
15
+ - update (`45a8d45`)
16
+
17
+
18
+ ## [1.2.4] - 2026-06-11
19
+
20
+ ### Features
21
+
22
+ - release body 自动提取当前版本 CHANGELOG 段 (`4f03302`)
23
+
24
+ ### Bug Fixes
25
+
26
+ - sed 模式改用 #+ 匹配任意层级标题,兼容 major/minor/patch 不同 # 数量 (`86f2e5b`)
27
+
28
+ ### Documentation
29
+
30
+ - update (`9e4fd55`)
31
+
32
+
3
33
  ## [1.2.3] - 2026-06-11
4
34
 
5
35
  ### Bug Fixes
package/README.md CHANGED
@@ -244,6 +244,10 @@ node process_videos.js --sheet "YouTube视频" --concurrency 2 --retry 3
244
244
 
245
245
  # 先干跑预览
246
246
  node process_videos.js --dry-run
247
+
248
+ # Excel 数据量大时,偏移+限量调试
249
+ node process_videos.js --offset 10 --limit 5 --dry-run # 跳过前10条,预览5条
250
+ node process_videos.js --limit 3 --concurrency 1 # 只处理前3条
247
251
  ```
248
252
 
249
253
  ### 重跑失败
@@ -344,6 +348,8 @@ node process_videos.js --input "downloads/产品介绍.mp4" --step analyze
344
348
  |---|---|---|---|
345
349
  | `--sheet <name>` | str | 全部 | 指定 sheet 名称 |
346
350
  | `--id <id>` | str | — | 指定 extra.id 或 title(单条测试) |
351
+ | `--offset <n>` | int | 0 | 跳过前 N 条任务(从 0 开始),适合调试大量数据 |
352
+ | `--limit <n>` | int | 0 | 最多处理 N 条任务,0 表示无限制 |
347
353
  | `--step <step>` | str | 全跑 | 只执行某步:`download` / `transcode` / `transcribe` / `analyze` |
348
354
  | `--force` | flag | off | 强制重做下载+转码,忽略已有文件 |
349
355
  | `--concurrency <n>` | int | 1 | 并发数,建议 2~3 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "video-pipeline",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "视频下载、转码、文本识别、AI 关键词分析一体化流程 CLI 工具",
5
5
  "keywords": [
6
6
  "video",
package/process_videos.js CHANGED
@@ -8,6 +8,7 @@
8
8
  * node process_videos.js --sheet "普诺赛中文站" --id 427
9
9
  * node process_videos.js --step download
10
10
  * node process_videos.js --dry-run
11
+ * node process_videos.js --offset 10 --limit 5 # 跳过前10条,只处理5条
11
12
  */
12
13
 
13
14
  // ============================== 依赖 ==============================
@@ -34,7 +35,7 @@ dotenv.config({ path: _dotenvPath });
34
35
  // ============================== 路径配置 ==============================
35
36
  const __filename = fileURLToPath(import.meta.url);
36
37
  const __dirname = path.dirname(__filename);
37
- const BASE_DIR = path.resolve(__dirname);
38
+ const BASE_DIR = process.cwd();
38
39
 
39
40
  function envPath(key, defaultValue) {
40
41
  const val = process.env[key] || defaultValue;
@@ -1763,6 +1764,7 @@ async function run({
1763
1764
  targetSheet, targetId, steps, maxRetries, retryDelay,
1764
1765
  concurrency, force, dryRun, retryFailed,
1765
1766
  downloadTimeout, transcodeTimeout, transcribeTimeout, analyzeTimeout,
1767
+ offset = 0, rowLimit = 0,
1766
1768
  }) {
1767
1769
  // ── 重跑失败模式 ──
1768
1770
  if (retryFailed) {
@@ -1772,7 +1774,7 @@ async function run({
1772
1774
 
1773
1775
  // ── 构建任务列表 ──
1774
1776
  const sheets = targetSheet ? [targetSheet] : VIDEO_SHEETS;
1775
- const tasks = [];
1777
+ let tasks = [];
1776
1778
  for (const sheetName of sheets) {
1777
1779
  let rows = readExcelSheet(sheetName);
1778
1780
  if (targetId) {
@@ -1796,6 +1798,15 @@ async function run({
1796
1798
  }
1797
1799
  }
1798
1800
 
1801
+ // ── 偏移/限量(全局,跨 sheet) ──
1802
+ if (offset > 0 || rowLimit > 0) {
1803
+ const start = offset;
1804
+ const end = rowLimit > 0 ? start + rowLimit : undefined;
1805
+ const originalLen = tasks.length;
1806
+ tasks = tasks.slice(start, end);
1807
+ logInfo(`applied offset=${start}, limit=${rowLimit || 'all'} → tasks: ${originalLen} → ${tasks.length}`);
1808
+ }
1809
+
1799
1810
  logInfo(`tasks: ${tasks.length}, concurrency: ${concurrency}, max retries: ${maxRetries}`);
1800
1811
 
1801
1812
  const envCheck = await checkEnvironmentAsync(steps);
@@ -2069,6 +2080,8 @@ if (process.argv[1] === __filename || process.argv[1]?.endsWith('process_videos.
2069
2080
  .description('视频下载、转码、文本识别、AI分析一体化流程')
2070
2081
  .option('--sheet <name>', '指定 sheet 名称')
2071
2082
  .option('--id <id>', '指定 extra.id 或 title(单条测试)')
2083
+ .option('--offset <n>', '跳过前 N 条任务(从 0 开始),默认 0', parseInt, 0)
2084
+ .option('--limit <n>', '最多处理 N 条任务,默认无限制', parseInt, 0)
2072
2085
  .option('--step <step>', '指定执行步骤(可多次指定),如 --step transcode --step transcribe', (val, prev) => {
2073
2086
  const allowed = ['download', 'transcode', 'transcribe', 'analyze'];
2074
2087
  if (!allowed.includes(val)) {
@@ -2359,6 +2372,8 @@ if (process.argv[1] === __filename || process.argv[1]?.endsWith('process_videos.
2359
2372
  targetSheet: opts.sheet || null,
2360
2373
  targetId: opts.id || null,
2361
2374
  steps,
2375
+ offset: opts.offset || 0,
2376
+ rowLimit: opts.limit || 0,
2362
2377
  maxRetries: opts.retry,
2363
2378
  retryDelay: opts.retryDelay,
2364
2379
  concurrency: opts.concurrency,