闲社服务运行正常AI智能体自动化平台
d

抖音内容追踪

技能标识:douyin-content-tracker

This skill should be used when the user wants to scrape Douyin (TikTok China) creator content, download audio, and transcribe it with Whisper. Covers first-time setup, daily incremental tracking, cookie refresh, and debugging. All pipeline scripts are bundled in this skill directory and can be run directly without any extra installation beyond pip and MediaCrawler.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

抖音内容追踪

抖音内容追踪器

通过MediaCrawler抓取抖音创作者视频,使用ffmpeg下载音频,并利用Whisper进行语音转文字。

查找技能基础目录

所有命令必须在此技能目录下运行。要定位该目录,请执行:

bash
python -c import pathlib; print([p for p in pathlib.Path.home().rglob(douyin-content-tracker-skill/SKILL.md)])

或检查常见位置:

  • - ~/.claude/skills/douyin-content-tracker-skill/
  • 安装技能时显示的路径

为了方便,将其设置为变量:
bash
SKILL_DIR=~/.claude/skills/douyin-content-tracker-skill # 根据实际路径调整
cd $SKILL_DIR



首次设置

在新机器上执行以下步骤一次。

1. 安装Python依赖

bash
cd $SKILL_DIR
pip install -r scripts/requirements.txt
python -m playwright install chromium

2. 安装MediaCrawler

bash

Windows


git clone https://github.com/NanmiCoder/MediaCrawler D:/MediaCrawler
cd D:/MediaCrawler && pip install -r requirements.txt

macOS/Linux

git clone https://github.com/NanmiCoder/MediaCrawler ~/MediaCrawler cd ~/MediaCrawler && pip install -r requirements.txt

3. 配置.env

bash
cd $SKILL_DIR
cp .env.template .env

编辑.env — 必填字段:
dotenv
MEDIACRAWLER_DIR=D:/MediaCrawler # 根据实际MediaCrawler路径调整(macOS/Linux使用~/MediaCrawler)

可选覆盖项:
dotenv

存储数据/音频/字幕/模型的位置(默认:~/DouyinContentTracker 或 %USERPROFILE%\DouyinContentTracker)


OUTPUTBASEDIR=/Users/me/DouyinContentTracker

Whisper模型大小(默认:medium)

WHISPER_MODEL=small

4. 添加目标账号

编辑accounts.txt(或设置TRACKERACCOUNTSFILE / 运行时传递--accounts-file):

博主名称 | https://www.douyin.com/user/MS4wLjABAAAA...

5. 首次登录(生成cookie)

bash
cd $SKILL_DIR
python scripts/scrape_profile.py

浏览器打开 — 扫描抖音二维码登录。Cookie保存到.douyin_cookies.json。



日常使用

bash
cd $SKILL_DIR

追踪每个账号最新的3个视频(默认)。main.py与track_latest.py功能相同

python scripts/track_latest.py

或

python scripts/main.py

追踪最新N个视频

python scripts/track_latest.py --limit 5

使用自定义账号列表(也可通过环境变量TRACKERACCOUNTSFILE设置)

python scripts/track_latest.py --accounts-file /path/to/accounts.txt

跳过音频下载和转录(仅获取数据)

python scripts/track_latest.py --no-audio

Cookie刷新

当抓取返回0个视频或提示Cookie 已 N 天未更新时:

bash
cd $SKILL_DIR
python scripts/scrape_profile.py # 打开浏览器,扫描二维码



处理流程

accounts.txt(或--accounts-file / TRACKERACCOUNTSFILE指向的列表)
↓
scripts/scrapeprofile.py → MediaCrawler (CDP) → OUTPUTBASE_DIR/data/*.csv
↓
scripts/cleandata.py → 标准化后的 OUTPUTBASEDIR/data/cleaned*.csv
↓
scripts/downloadvideo.py → Playwright + ffmpeg → OUTPUTBASE_DIR/audio/{博主}/*.m4a
↓
scripts/extractsubtitle.py → Whisper → OUTPUTBASE_DIR/subtitles/{博主}/{视频ID}.md

输出位置

所有生成的文件位于OUTPUTBASEDIR下(macOS/Linux默认为~/DouyinContentTracker,Windows默认为%USERPROFILE%\DouyinContentTracker)。

子目录内容
data/cleaned_*.csv抓取并标准化后的视频元数据
audio/{博主}/{视频ID}.m4a
提取的音频 |
| subtitles/{博主}/{视频ID}.md | Whisper转录文本(标题作为第一行) |
| subtitles/{博主}.md | 合并后的单个博主所有转录文本 |


执行日志指南

运行处理流程时,在每一步完成后向用户报告进度。不要等到整个流程结束再报告。

分步报告模板:

每次Bash工具调用返回后,立即告知用户:

步骤报告内容
采集(scrape)博主名称、采集到的视频条数,若失败注明原因
清洗(clean)
清洗后有效条数 |
| 音频下载(download) | 成功下载的音频数 / 总数,跳过的条数 |
| 语音识别(whisper) | 生成的字幕文件数,输出路径 |
| 完成 | 汇总:共处理博主数、视频数、生成字幕数,以及输出目录路径 |

如果某一步失败,停止流程,逐字报告错误输出,并从references/troubleshooting.md中建议相应的修复方案,然后询问用户是否继续。

示例输出风格:

[步骤 1/4 采集] 博主「某某」— 采集完成,共 10 条视频
[步骤 2/4 清洗] 有效数据 10 条 → data/cleanedprofilexxx.csv
[步骤 3/4 音频] 下载完成 8/10(2 条无音频流,已跳过)
[步骤 4/4 字幕] 生成 8 个字幕文件 → subtitles/某某/
[完成] 1 位博主 · 10 条视频 · 8 个字幕,输出目录:~/DouyinContentTracker



参考资料

调试或扩展处理流程时,将以下文件加载到上下文中:

  • - references/pipeline.md — 各脚本技术详解、数据模式、关键函数签名
  • references/troubleshooting.md — cookie、MediaCrawler、ffmpeg、Whisper和数据错误的修复方案

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 douyin-content-tracker-skill-1776115099 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 douyin-content-tracker-skill-1776115099 技能

通过命令行安装

skillhub install douyin-content-tracker-skill-1776115099

下载

⬇ 下载 douyin-content-tracker v1.0.0(免费)

文件大小: 32.05 KB | 发布时间: 2026-4-14 12:59

v1.0.0 最新 2026-4-14 12:59
Add step-by-step execution logging guide
返回顶部