douyin-scraper
Skill4 starsChanged 3 months agoMITView on GitHub
从抖音视频、图文及账号主页链接提取作品链接、文案、封面和互动数据,核验作者与作品ID,支持飞书多维表格回填及公开视频画面解析。适用于抖音链接抓取、主页作品收集与已有内容数据补齐。
In this repository22 other files it gives its agents.
- aihotSkill
- bilibili-creator-finderSkill
- feishu-cli-managerSkill
- funcinating-guidesSkill
- funcinating-newsSkill
- hot-topicsSkill
- humanizerSkill
- humanizer-zhSkill
- imap-smtp-emailSkill
- lark-base-replicaSkill
- oss-uploadSkill
- seedance-promptSkill
- shopifySkill
- skill-publisherSkill
- skill-vetterSkill
- slider-captchaSkill
- tikhub-querySkill
- tiktok-scraperSkill
- video-downloadSkill
- wechat-scraperSkill
- weibo-scraperSkill
- xiaohongshu-scraperSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 11 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill for 抖音公开视频链接抓取和飞书 Base 回填.
- Distinctive: line 18
Use the user's fixed MD-Browser Douyin configuration as the source of truth.
- Very specific: line 20
Read the current configuration through MD-Browser MCP and verify its label, userDataDir, profile, CDP endpoint, and network route against …
- Very specific: line 26
Keep the existing worker tab in the background.
- Distinctive: line 32
Do not use the daily Chrome profile for scraping.
- Distinctive: line 66
If public access fails and the user explicitly agrees to fallback, retry with a logged-in Chrome profile:
- Distinctive: line 77
Do not wrap the scraper in a shell loop.
- Very specific: line 78
When --browser-confirm is used, still run public access first.
- Very specific: line 83
If direct navigation in the first tab triggers login friction but manual opening a link in a new tab works, use --new-tab with --cdp-url.
- Very specific: line 93
Use 抓取状态 as the control plane:
- Very specific: line 105
Use 评论状态 as a separate operations queue:
- Very specific: line 138
When falling back to visible page metrics, video pages usually show 点赞数 / 评论数 / 收藏数 / 分享.
- Very specific: line 139
If the visible engagement UI shows only bare labels such as 赞 or 收藏 with no number, write 0 for that metric.
- Very specific: line 151
Use ffmpeg to create a contact sheet from representative frames.
- Very specific: line 152
Use MiniMax mmx vision describe --region global when available to describe visible captions, scene, product/person/place details, and …
- Distinctive: line 156
Do not claim audio transcript accuracy unless an ASR tool actually processed the audio.
- Distinctive: line 160
Do not bypass CAPTCHAs, paywalls, private content, account restrictions, or platform access controls.
- Distinctive: line 161
Do not export or print cookies, tokens, localStorage, QR codes, or profile secrets.
- Distinctive: line 162
Stop immediately on CAPTCHA, access anomaly, platform warning, or account-risk signal.
- Distinctive: line 163
Keep logged-in fallback batches small, normally 3-5 rows.
- Distinctive: line 164
After a platform warning, pause logged-in browser scraping for at least 24-48 hours.
- Very specific: line 168
Read references/strategy.md before changing status rules, browser fallback, video parsing, or Base write semantics.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Douyin Scraper
Overview
Use this skill for 抖音公开视频链接抓取和飞书 Base 回填. Default to public, non-logged-in access. Use a logged-in Chrome profile only as a low-frequency fallback after user consent.
完整处理工作流
账号检测新增、指定作品补采和下游归档处理时,阅读 列表媒体与下游工作流。主页采集仍只输出报告;视频下载复用 video-download。归档、分析、产品匹配和业务表回填由调用方实现,不隐式上传或修改业务数据。
Browser Profile
Use the user's fixed MD-Browser Douyin configuration as the source of truth.
- Read the current configuration through MD-Browser MCP and verify its label,
userDataDir, profile, CDP endpoint, and network route against the user's choice. - Launch/connect through MD-Browser MCP; pass its exact returned endpoint to the
scraper. Do not replace
127.0.0.1with[::1]or invent another directory/port. - On a port conflict, inspect the listener and report the owning process. Do not switch ports/profiles or terminate the daily browser without specific approval.
- Keep the existing worker tab in the background; do not call
bring_to_front()or activate Chrome unless the user asks to watch or log in. A new browser or tab may still become visible; do not promise zero focus changes without testing. - Different profile directories have separate login state. Never import cookie files into a live managed session or overwrite/migrate a profile implicitly.
Do not use the daily Chrome profile for scraping. The examples below using a manually supplied profile are standalone fallbacks, not a replacement for an existing user-managed MD-Browser configuration. Only use them when explicitly chosen.
Homepage collection
For /user/<sec_uid> collection or bulk enrichment, read
Homepage extraction rules and use
scripts/scrape-profile.py. It requires an existing browser endpoint, performs
bounded background collection, and writes a local report without changing Base.
Video display covers use returned URLs for the same video.cover.uri, verify
actual static-image dimensions, and prefer the largest verified candidate rather
than the first thumbnail. Keep the original URL if probing fails; origin_cover
is only an explicit missing-display fallback. See the reference for quality and
provenance fields. Never substitute a different image or animated cover silently.
Homepage records are not single-detail-page verification.
Workflow
In managed mode, set DOUYIN_CDP_URL to the exact endpoint returned by MD-Browser.
- Extract canonical URLs from raw text, Markdown links, or Base cells.
- For one-off diagnostics, run:
python3 ~/.agents/skills/douyin-scraper/scripts/scrape-douyin.py --json < urls.txt - For Lark Base batch work, use the safe Base entrypoint:
node ~/.agents/skills/douyin-scraper/scripts/process-lark-douyin.mjs \ --base-token <base_token> \ --table-id <table_id> \ --view-id <view_id> \ --batch-size 10 - If public access fails and the user explicitly agrees to fallback, retry with a logged-in Chrome profile:
node ~/.agents/skills/douyin-scraper/scripts/process-lark-douyin.mjs \ --base-token <base_token> \ --table-id <table_id> \ --view-id <view_id> \ --browser-confirm \ --chrome-user-data-dir "$HOME/Library/Application Support/Google/DouyinChrome" \ --batch-size 3
Do not wrap the scraper in a shell loop. Batch mode must reuse one browser context for the whole batch and should write each row back to Lark immediately after that row's scrape result is produced.
When --browser-confirm is used, still run public access first; retry only the failed rows with the logged-in Chrome profile.
For repeated visible-browser diagnostics or fallback, prefer a long-lived Chrome opened with remote debugging and pass --cdp-url "$DOUYIN_CDP_URL" plus --cdp-only when the user explicitly wants all rows to use that visible browser. Do not repeatedly open and close Chrome.
Important: login state belongs to the Chrome profile that is open. A cookie file saved by another helper or a different --user-data-dir is not the same as the visible CDP browser profile. When using --cdp-url, do not inject saved cookie files into that browser context; trust the live profile's own cookies. If a new CDP profile is used, the user may need to log in there once, then keep that browser open.
If direct navigation in the first tab triggers login friction but manual opening a link in a new tab works, use --new-tab with --cdp-url. This creates a dedicated tab inside the same live Chrome profile and leaves the user's existing login tab untouched.
In CDP mode, --new-tab means "use the reusable worker tab", not "create a fresh tab every run". The scraper finds a tab whose window.name is codex-douyin-worker; if none exists, it creates one and then keeps reusing it by replacing the URL. Use --worker-tab-name <name> only when intentionally running a separate isolated Douyin worker.
For logged-in comment execution, use the same long-lived CDP browser and add --comment. This posts only when all conditions are true: 抓取状态=保持抓取, 生成评论 is non-empty, and 评论状态 is blank or 准备评论. Never comment rows already marked 评论成功, 取消评论, or 评论失败.
The Base entrypoint uses a local platform lock at /tmp/social-scraper-locks/douyin.lock; do not run two Douyin jobs at the same time from different sessions.
Lark Status Rules
Use 抓取状态 as the control plane:
- blank/null: treat as
准备抓取. 准备抓取: first scrape. Fetch正文,点赞数,收藏数, and抓取时间. For videos, add visual-frame analysis to正文.保持抓取: refresh only点赞数,收藏数, and抓取时间. Do not fetch or overwrite正文by default.抓取异常: confirmed deleted, unavailable, non-existent, login-blocked after allowed fallback, or unsafe to retry.停止抓取: manual or rule-based stop state for rows that no longer need engagement tracking.
Default runs process rows whose 抓取状态 is blank, 准备抓取, or 保持抓取. On successful 准备抓取, write body and engagement fields, then set 抓取状态=保持抓取. On successful 保持抓取, update only engagement fields and 抓取时间. On confirmed terminal failure, set 抓取状态=抓取异常, write 抓取时间, and preserve existing useful values. 停止抓取 is not set automatically unless a separate stop-tracking rule is explicitly enabled.
Comment Status Rules
Use 评论状态 as a separate operations queue:
- blank/null: default, not yet selected for commenting.
准备评论: selected by threshold or manual review and waiting for comment execution.取消评论: manually decided not to comment.评论成功: comment has been posted.评论失败: a comment attempt failed and is not currently being retried.
The table does not need a 评论方式 field unless platform behavior becomes mixed. Keep 评论状态 blank by default; use 准备评论 only when a row has been selected for commenting. Douyin comments can be posted automatically from the logged-in CDP browser with:
node ~/.agents/skills/douyin-scraper/scripts/process-lark-douyin.mjs \
--base-token <base_token> \
--table-id <table_id> \
--view-id <view_id> \
--cdp-url "$DOUYIN_CDP_URL" \
--cdp-only \
--new-tab \
--worker-tab-name codex-douyin-worker \
--comment \
--batch-size 3Comment automation uses page DOM controls inside #comment-input-container, fills .public-DraftEditor-content[contenteditable=true], clicks the publish control inside the same container, then verifies the comment text appears before writing 评论成功. On failure it writes 评论失败. Do not use coordinate clicks in production batches.
Output Rules
正文: original Douyin caption/title first. For videos, append:【视频内容解析】 ...点赞数: Douyindigg_countwhen available.收藏数: Douyincollect_countwhen available.- When falling back to visible page metrics, video pages usually show
点赞数 / 评论数 / 收藏数 / 分享; do not treat the second visible number as收藏数when three metrics are present. - If the visible engagement UI shows only bare labels such as
赞or收藏with no number, write0for that metric. 抓取时间: use local datetime rounded to minutes, e.g.YYYY-MM-DD HH:mm:00.- Missing engagement counts mean unavailable, not zero. Do not overwrite existing useful values with blanks.
Video Analysis
For 准备抓取 video rows:
- Resolve the short link to the real video page.
- Capture public page/network metadata.
- Extract the current
/video/<aweme_id>from the resolved page URL and use only the matching aweme record'svideo.play_addr/download_addrstream URL. - Download the video to a task-specific local folder.
- Use
ffmpegto create a contact sheet from representative frames. - Use MiniMax
mmx vision describe --region globalwhen available to describe visible captions, scene, product/person/place details, and narrative.
Do not use the first network-captured douyinvod response as the video source. In a reused browser page it can belong to the previous item, recommendation feed, or preloaded media. If a current-aweme-bound video URL is unavailable, skip video analysis and still write the caption/engagement values.
Do not claim audio transcript accuracy unless an ASR tool actually processed the audio.
Safety
- Do not bypass CAPTCHAs, paywalls, private content, account restrictions, or platform access controls.
- Do not export or print cookies, tokens, localStorage, QR codes, or profile secrets.
- Stop immediately on CAPTCHA, access anomaly, platform warning, or account-risk signal.
- Keep logged-in fallback batches small, normally 3-5 rows.
- After a platform warning, pause logged-in browser scraping for at least 24-48 hours.
References
- Read
references/strategy.mdbefore changing status rules, browser fallback, video parsing, or Base write semantics.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

