Install
openclaw skills install @terrycarter1985/douyin-scraper-v2openclaw skills install @terrycarter1985/douyin-scraper-v2获取抖音热榜和搜索数据。当前版本使用抖音 Web API,无需登录。
抖音搜索 API 需要登录态,当前版本在无登录环境下使用以下替代方案:
如需完整搜索功能,需要提供抖音登录 Cookie。
cd <skill-dir>
npm install
Playwright 浏览器(可选,用于完整搜索):
npx playwright install chromium
# 搜索关键词
node scripts/douyin_scraper.js search "海鲜" 20
# 获取热榜
node scripts/douyin_scraper.js hot 50
# 获取搜索建议
node scripts/douyin_scraper.js suggest "海鲜售卖"
# 保存到文件
node scripts/douyin_scraper.js search "海鲜" 10 --output result.json
# 搜索关键词
python scripts/scraper.py search --keyword "海鲜" --limit 20
# 获取热榜
python scripts/scraper.py hot --limit 50
# 获取搜索建议
python scripts/scraper.py suggest --keyword "海鲜售卖"
当用户用自然语言请求抖音相关数据时,按以下规则解析:
| 用户说法 | 意图 | 命令 |
|---|---|---|
| 搜索一下海鲜视频 / 找一些海鲜视频 | 搜索 | search "海鲜" |
| 看看抖音热榜 / 抖音最近什么火 | 热榜 | hot |
| 海鲜相关的搜索建议 | 建议 | suggest "海鲜" |
| 海鲜售卖视频文案 | 搜索 | search "海鲜售卖" |
| 分析这个视频链接 xxx | 暂不支持 | 提示用户 |
从自然语言中提取关键词:
海鲜海鲜售卖小龙虾美食 (搜索热榜匹配){
"keyword": "海鲜",
"matched_hot": [
{
"rank": 1,
"word": "海鲜话题",
"hot_value": 5000000,
"video_count": 10
}
],
"suggestions": [
{ "word": "海鲜小哥", "group_id": "xxx" }
],
"hot_list": [...],
"note": "在热榜中找到 1 个匹配话题"
}
[
{
"rank": 1,
"word": "热搜话题",
"hot_value": 12000000,
"video_count": 6,
"group_id": "xxx",
"sentence_id": "xxx"
}
]
| 问题 | 解决方案 |
|---|---|
| API 返回 2483 | 搜索需要登录,使用 hot 或 suggest 替代 |
| 网络超时 | 检查网络连接,重试 |
| 无匹配结果 | 关键词可能不在热榜,尝试 suggest 获取相关词 |