piracy-handler

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Piracy Handler

Piracy Handler(盗版内容处理工具)

用于“综合页搜索完成后”的后置编排:盗版检测(只读)→ 子任务创建 → webhook 计划 upsert。
用于综合页搜索完成后的后置流程编排:盗版检测(只读)→ 子任务创建 → webhook计划更新或插入(upsert)。

路径约定

路径约定

统一安装与执行目录:
~/.agents/skills/piracy-handler/
。执行前先进入该目录:
bash
cd ~/.agents/skills/piracy-handler
统一安装与执行目录:
~/.agents/skills/piracy-handler/
。执行前请先进入该目录:
bash
cd ~/.agents/skills/piracy-handler

Quick start

快速开始(Quick start)

~/.agents/skills/piracy-handler/
目录运行:
bash
npx tsx scripts/piracy_detect.ts --task-id <TASK_ID>
npx tsx scripts/piracy_create_subtasks.ts --task-id <TASK_ID>
npx tsx scripts/piracy_upsert_webhook_plans.ts --task-id <TASK_ID>
更完整命令与调试示例见
references/commands.md
~/.agents/skills/piracy-handler/
目录中运行以下命令:
bash
npx tsx scripts/piracy_detect.ts --task-id <TASK_ID>
npx tsx scripts/piracy_create_subtasks.ts --task-id <TASK_ID>
npx tsx scripts/piracy_upsert_webhook_plans.ts --task-id <TASK_ID>
更完整的命令与调试示例请查看
references/commands.md

Workflow(高层)

高层工作流(Workflow)

  1. 从本地 sqlite
    capture_results
    读取综合页采集结果。
  2. 通过
    TaskID
    从任务状态表补齐
    BookID
    capture_results
    不含 BookID)——委托
    feishu-bitable-task-manager
  3. GroupID={MapAppValue(任务App)}_{BookID}_{UserKey}
    聚类。
  4. 从原始剧单按 BookID 查询总时长,换算后计算阈值并筛选命中分组。
  5. 为命中分组创建子任务(个人页必建,合集/锚点按条件)——委托
    feishu-bitable-task-manager
  6. 创建/更新
    BizType=piracy_general_search
    的 webhook 推送计划——委托
    group-webhook-dispatch
  1. 从本地sqlite的
    capture_results
    表中读取综合页采集结果。
  2. 通过
    TaskID
    从任务状态表补充获取
    BookID
    capture_results
    表中不包含
    BookID
    )——该操作委托给feishu-bitable-task-manager执行。
  3. 使用
    GroupID={MapAppValue(任务App)}_{BookID}_{UserKey}
    规则进行聚类。
  4. 根据
    BookID
    从原始剧单中查询内容总时长,换算后计算阈值并筛选出符合条件的盗版分组。
  5. 为命中的盗版分组创建子任务(个人页内容必创建子任务,合集/锚点内容按条件创建)——该操作委托给feishu-bitable-task-manager执行。
  6. 创建或更新
    BizType=piracy_general_search
    的webhook推送计划——该操作委托给group-webhook-dispatch执行。

I/O(默认路径约定)

输入输出约定(I/O)

  • piracy_detect.ts
    默认写入
    ~/.eval/<TaskID>/detect.json
    (避免多设备并行冲突)。
  • 未指定
    --input
    时,后续命令可用
    --task-id <TaskID>
    ~/.eval/<TaskID>/detect.json
    读取。
  • piracy_detect.ts
    默认将结果写入
    ~/.eval/<TaskID>/detect.json
    (避免多设备并行执行时产生冲突)。
  • 若未指定
    --input
    参数,后续命令可通过
    --task-id <TaskID>
    ~/.eval/<TaskID>/detect.json
    读取数据。

Required env

必需环境变量(Required env)

  • FEISHU_APP_ID
    ,
    FEISHU_APP_SECRET
  • TASK_BITABLE_URL
    (任务状态表)
  • DRAMA_BITABLE_URL
    (原始剧单/元信息表)
  • WEBHOOK_BITABLE_URL
    (推送计划表)
  • FEISHU_APP_ID
    ,
    FEISHU_APP_SECRET
  • TASK_BITABLE_URL
    (任务状态表的链接)
  • DRAMA_BITABLE_URL
    (原始剧单/元信息表的链接)
  • WEBHOOK_BITABLE_URL
    (推送计划表的链接)

Dependencies

依赖项(Dependencies)

  • 调用其它 skills 时遵循各自的
    Path Convention
    /
    路径约定
    (统一安装路径:
    ~/.agents/skills/<skill>/
    ),推荐在脚本里使用单条 subshell 执行避免
    cd
    漂移:
    • (cd ~/.agents/skills/feishu-bitable-task-manager && npx tsx scripts/bitable_task.ts ...)
    • (cd ~/.agents/skills/feishu-bitable-task-manager && npx tsx scripts/drama_fetch.ts --format meta ...)
    • (cd ~/.agents/skills/group-webhook-dispatch && npx tsx scripts/upsert_webhook_plan.ts ...)
  • 调用其他skill时需遵循各自的路径约定(Path Convention),所有skill的统一安装路径为
    ~/.agents/skills/<skill>/
    。推荐在脚本中使用单条子shell(subshell)执行命令,避免目录切换(cd)导致的路径异常:
    • (cd ~/.agents/skills/feishu-bitable-task-manager && npx tsx scripts/bitable_task.ts ...)
    • (cd ~/.agents/skills/feishu-bitable-task-manager && npx tsx scripts/drama_fetch.ts --format meta ...)
    • (cd ~/.agents/skills/group-webhook-dispatch && npx tsx scripts/upsert_webhook_plan.ts ...)

Resources

资源文件(Resources)

  • scripts/piracy_detect.ts
    : 阈值检测(输出 JSON)
  • scripts/piracy_create_subtasks.ts
    : 子任务创建(写任务状态表)
  • scripts/piracy_upsert_webhook_plans.ts
    : webhook 计划 upsert(写推送计划表)
  • Read
    references/commands.md
    for field conventions and debug flags.
  • scripts/piracy_detect.ts
    :阈值检测工具(输出JSON格式结果)
  • scripts/piracy_create_subtasks.ts
    :子任务创建工具(写入任务状态表)
  • scripts/piracy_upsert_webhook_plans.ts
    :webhook计划更新/插入工具(写入推送计划表)
  • 如需了解字段约定与调试参数,请查看
    references/commands.md