douyin-open-cli companion / 抖音官方 CLI 搭档
Douyin's official douyin-open-cli (抖音开放平台, released 2026-12-04) lets an agent act on the user's own Douyin account after a QR scan: search Douyin, read a work's text (high_quality_text), list comments. This skill adds what it does not give, through LinkDigest, and says plainly when the CLI alone is enough.
Which tool for which job
| The user wants | Use |
|---|---|
| Find Douyin videos on a topic (recent 1 / 7 / 180 days, by likes or newest) | douyin-open-cli search video |
| What a video says, as plain text | The high_quality_text already in the CLI's search result: no LinkDigest credits needed |
Transcript with a start time per line, or an .srt subtitle file |
LinkDigest: scripts/linkdigest.py + scripts/to_srt.py |
| Text on screen with the time it appears; key points checked against the words said | LinkDigest |
| One comparison page across several videos, shareable | LinkDigest: scripts/compare.py |
| The same topic on 小红书, B站, YouTube, X | LinkDigest (any of its links) |
| Comments | douyin-open-cli comment list (personal data: use the comment text only) |
Workflow
export LINKDIGEST_API_KEY=ld_live_... # https://linkdigest.dev/signin?ref=skill-douyin-open-cli-companion&next=/app/keys — 5 free credits
# 1. Search with the official CLI (the user's own login; see "Rules")
douyin-open-cli search video --keyword 露营装备 --sort-type 1 --publish-time 7 --count 10 > search.json
# 2. Pick: links of the top 5 by likes → links.txt (a table goes to stderr)
python3 {baseDir}/scripts/cli_links.py --sort likes --top 5 < search.json > links.txt
# 3a. One video → SRT subtitles with timestamps
python3 {baseDir}/scripts/linkdigest.py "https://v.douyin.com/VeXgdE_QwTE" --format json | python3 {baseDir}/scripts/to_srt.py - --out video.srt
# 3b. Several videos → one comparison page
python3 {baseDir}/scripts/compare.py --file links.txt --label "露营装备 7天高赞"
For the agent:
- Search with the CLI. If the user only needs to know what the videos say, answer from
high_quality_textand stop; do not spend credits. - Pick with
cli_links.py; show the stderr table (likes, whether text came back, title) and confirm the picks. - Read with LinkDigest only for what the CLI lacks: timestamps / SRT, on-screen text with times, checked key points, a comparison, other platforms.
- Report which video each point comes from, and the credits used (last stderr line of each script).
Rules
douyin-open-cliacts on the user's own account. Never ask for, show or log their QR code beyond the login step, tokens, or--debug-unsafeoutput. Its login lasts hours, not days; when it expires, the user scans again.- Keep CLI calls few. Every request carries the user's real-name account; it is not a bulk collector.
- Comment lists and user searches contain personal data. Use comment text only. Never paste lists of nicknames or accounts.
- The LinkDigest key stays in the environment, never in chat or code.
Cost (LinkDigest only; the official CLI is free)
| Step | Credits |
|---|---|
| Read a video under 1 min | 2 |
| Read a 3-min / 10-min video | 4 / 11 |
| A link anyone has read before (cache) | 0 |
| A link that can't be read | 0 |
| Comparison page | 1 per started 10 videos |
to_srt.py and cli_links.py run locally and cost nothing. Cap a read with --max-credits 5; when credits run out the read answers 402 and charges nothing.
Scripts
scripts/cli_links.py: douyin-open-cli search JSON on stdin → onehttps://www.douyin.com/video/<item_id>per line. No network.scripts/to_srt.py: a LinkDigest JSON read →.srt. Lines end where the next begins (cut at speech pauses, not frame-exact). No network.scripts/linkdigest.py: read one link (transcript, on-screen text, key points). Talks only to linkdigest.dev.scripts/compare.py: read several links, then one comparison page. Talks only to linkdigest.dev.
