Pluviobyte/douyin-comments

Data

An Agent Skill that captures a Douyin video's full comment thread through your logged-in Chrome session.

100
31
JavaScript
new today

This is an Agent Skill for pulling the complete comment section of a single Douyin video: top-level comments, all nested replies, video details, and optionally the video itself, produced as a like-sorted Markdown digest plus raw JSON. It suits people who already have Claude Code with the Chrome extension and a logged-in Douyin session, and want comment data for personal research or content reference without a paid API.

How it works

Douyin's web comment endpoints require anti-bot parameters (a_bogus, msToken, uifid, and roughly 30 other common parameters). Rather than reconstructing them, the skill reuses the page's own requests. It first intercepts the page's initial comment request to record a URL-and-header template (page_hook.js). The main path (page_fetch.js) then resends that template from within the page's XHR, swapping only aweme_id, cursor, and comment_id, so the page SDK supplies the signature. A slower fallback (page_ui_expand.js) clicks each "expand N replies" control and captures the responses the page generates itself. A local receiver (recv.py) posts each page to 127.0.0.1 for storage, and build_report.py deduplicates and checks reply counts per thread before generating the report full README.

Requests are paced 2–4 seconds apart, with an extra 8–15 second pause every 15 requests.

Requirements and installation

The skill runs inside Claude Code with the Claude in Chrome browser extension connected (via /chrome), uses a Chrome session already logged into Douyin, and needs Python 3 (standard library only) and curl. Installation clones the repository under ~/.claude/skills/douyin-comments or a project's .claude/skills/; check an existing target directory rather than overwriting it installation notes.

You then give Claude Code a Douyin link and ask it to capture comments. It accepts douyin.com/video/<id>, a profile link with modal_id=<id>, and v.douyin.com short links. Output goes to .internal/抖音评论/<aweme_id>/, containing the raw page responses, deduplicated comment and reply JSON, 评论全文.md with replies indented beneath their parent comment, and an optional video file. The full procedure is in SKILL.md.

Measured results and limits

The author reports two runs: a 7-minute video yielded 83 top-level comments plus 112 replies (195 total, matching the displayed count) in 35 requests over 138 seconds, and a 46-minute tutorial yielded 77 plus 58 (135 total, matching) in 63 requests over 252 seconds, with no captcha in either README. The first result was compared comment-by-comment against manually expanding replies in the UI, which took about 6 minutes.

Important boundaries: the skill does not solve captchas; if one appears it halts until you complete it manually in Chrome and then continue. It handles one video at a time, not bulk creator scraping, and supports neither Xiaohongshu nor Bilibili. Deleted, collapsed, or author-only comments are not returned by the API, so totals can fall slightly below the displayed count. Paging for a single thread with more than 20 replies and videos with thousands of comments are untested. The author scopes use to personal research and content reference, and asks users to follow Douyin's terms, limit request frequency, and avoid bulk collection or commercial redistribution. No license is declared in the repository repository.

Written by AI from the project's README, updated October 30, 2026. The project's own docs are the source of truth.