Skip to content

Pluviobyte/saas-growth-agents / bots/social-kb/douyin-comments

douyin-comments

Verified

抓取抖音单条视频的完整评论区(一级评论 + 全部楼中楼回复)和视频详情,可选下载视频,输出按点赞排序的「评论全文.md」和原始 JSON。在已登录抖音的真实浏览器里运行(Claude in Chrome,或 Grok Bot 等 Agent 自带、能执行页面脚本的浏览器),借页面自带 SDK 签名,不需要 TikHub、Playwright 或 a_bogus 逆向。用户给出抖音视频链接(douyin.com/video/…、带 modal_id 的主页链接、v.douyin.com 短链),并说"看评论区""抓评论""拉评论""评论区有什么质疑/疑问""参考评论区"时使用。只适用于抖音单条视频;小红书、B 站、批量采集博主全部作品不适用。

FileKindSize
SKILL.mdskill md9.4 KB
scripts/build_report.pyscript3.6 KB
scripts/download_video.pyscript1.1 KB
scripts/page_fetch.jsscript4.3 KB
scripts/page_hook.jsscript2.1 KB
scripts/page_ui_expand.jsscript1.8 KB
scripts/recv.pyscript1.6 KB

scripts/download_video.py

View on GitHub
#!/usr/bin/env python3
"""可选:从 raw/detail.json 选 720p mp4 档位,带 Referer 下载视频(无需 Cookie)。

用法:python3 -I download_video.py <输出目录> [文件名,默认 参考视频.mp4]
"""
import json
import os
import subprocess
import sys

out = sys.argv[1]
name = sys.argv[2] if len(sys.argv) > 2 else "参考视频.mp4"
with open(os.path.join(out, "raw", "detail.json")) as f:
    a = json.load(f)["aweme_detail"]

rates = a["video"].get("bit_rate") or []
short = lambda b: min(b["play_addr"].get("width", 0), b["play_addr"].get("height", 0))
mp4 = [b for b in rates if b.get("format") == "mp4"]
pick = sorted([b for b in mp4 if short(b) >= 720], key=short)[:1] or mp4[:1] or rates[:1]
if not pick:
    sys.exit("detail.json 里没有可下载的视频档位")
url = pick[0]["play_addr"]["url_list"][0]
dst = os.path.join(out, name)
subprocess.run(["curl", "-sL", "-e", "https://www.douyin.com/", "-o", dst, url], check=True)
print(f"{dst} ({os.path.getsize(dst) // 1024} KB, {pick[0]['play_addr'].get('width')}x{pick[0]['play_addr'].get('height')})")
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall