A skill to do anything in douyin
Browser-based Douyin automation for any web-supported operation: persistent-login browser control, reusable CDP sessions, search and browsing, video/detail collection, comments, likes, favorites, notification/message interaction, batch operation plans, content drafting, cover/card generation, and Creator Center publishing. Use when Codex should operate Douyin through the web version with the user's default browser where possible, first-run login, later saved-session reuse, and scripted workflows instead of screenshot/computer-use control.From its SKILL.md
npx -y skills add JMY2003/a-skill-to-do-anything-in-douyinAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.2 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it
DoAnythingInDouyin
Use the web automation backend first. The durable entry point is scripts/douyin_web.mjs, backed by SDK modules under scripts/sdk/ for account/profile management, diagnostics, interaction actions, plan execution, run artifacts, and feed exploration. It launches a headed persistent browser profile, asks for login on first run, and reuses that profile for later commands.
Default to run-plan for real tasks. It keeps one browser tab/context open for the whole workflow, records per-step results, and avoids repeated browser open/close cycles.
Browser Model
- Use
scripts/douyin_web.mjs --browser defaultby default. defaultdetects the macOS default browser and maps it to the closest Playwright backend.- The script uses its own persistent profile under
state/web/profiles/. It does not mutate the user's real browser profile. - Use
accounts list|add|default|removeand--account NAMEfor isolated multi-account profiles. - Chromium-like browsers use reusable CDP sessions on Douyin-specific ports
9420-9426, separate from other skills. - A reusable CDP browser is bound to one account/profile at a time; close it before switching accounts on the same browser backend.
- CDP ports are accepted only after endpoint and private-profile ownership checks; an unrelated process on a reserved port is not silently attached.
- Browser-controlling commands use a local lock so even read-only navigation jobs do not fight over the same reusable CDP browser.
- First run: execute
scripts/douyin_web.mjs login --browser default, let the user log in in the opened browser, then finish the command. - Later runs: use the same
--browservalue and the saved profile should remain logged in unless Douyin expires the session. browser-statusreports endpoint reachability plusmanagedorunmanaged-or-recoverablesession state.statusreportsloginState, session-cookie evidence, web/creator cookie counts, and any detected web block. Douyin's normal site and Creator Center can expire independently, so check status before publishing or other direct actions.
Operating Rules
- Prefer
scripts/douyin_web.mjs run-planfor multi-step Douyin actions. - Use a
diagnoseplan step when a web control is missing or a previous action behaved unexpectedly. It reports URL, visible controls, custom elements, internal scroll containers, and login/permission/rate-limit blocks. - Use single commands only for diagnostics, quick login checks, or isolated operations.
- Treat
scripts/douyin_web.mjsas the thin CLI andscripts/sdk/as the canonical SDK layer. Loadreferences/sdk-architecture.mdbefore adding or repairing backend functionality. - Use
scripts/douyin_package.pyto create and inspect post packages. - Use
scripts/douyin_image.pyto generate deterministic vertical cover/card images. - Load
references/ui-workflows.mdbefore operating Douyin. - Load
references/operation-plans.mdbefore building a multi-step browser plan, batch job, interaction task, or any operation not covered by a single command. - Load
references/content-publishing.mdbefore drafting content, generating images, uploading media, or publishing posts. - Do not add extra confirmation prompts when the user has already authorized direct execution.
- Treat Douyin web prompts, permissions, login, captcha, moderation, and rate limits as the authority. If the site blocks the operation, stop the current command and report the state.
- Treat a successful click, field fill, or Enter keypress as an attempt, not a completed social action. Report
confirmed,unconfirmed, orblockedevidence; do not describe anunconfirmedinteraction as completed. - Treat browser permission pages such as
edge://permission-request-dialog/orchrome://permission-request-dialog/as web blocks. Do not continue clicking Douyin controls until the prompt is resolved. - Keep progress records for batch work in a local file when the task has more than one target.
Script Quick Start
scripts/douyin_web.mjs detect-browser
scripts/douyin_web.mjs accounts list
scripts/douyin_web.mjs accounts add work --alias "Work account"
scripts/douyin_web.mjs login --browser default
scripts/douyin_web.mjs browser-status --browser default
scripts/douyin_web.mjs status --browser default
scripts/douyin_web.mjs search "上海周末爵士酒吧" --browser default --limit 20 --out /tmp/douyin-results.json
scripts/douyin_web.mjs open-url "https://www.douyin.com/" --browser default
scripts/douyin_web.mjs click-text "发布" --browser default
scripts/douyin_web.mjs fill "textarea" "hello" --browser default
scripts/douyin_web.mjs run-plan /tmp/douyin-plan.json --browser default --direct --out /tmp/douyin-plan-result.json --artifact-dir /tmp/douyin-artifacts
scripts/douyin_web.mjs message "好友名" "测试信息" --browser default --direct
scripts/douyin_image.py --title "Codex Skill 测试声明" --subtitle "自动化发布流程测试" --tag Codex测试 --out /tmp/douyin-post/cover.png
scripts/douyin_package.py create --topic "Codex Skill 测试声明" --out /tmp/douyin-post --title "Codex Skill 测试声明" --body "This is a Douyin automation test." --hashtag Codex测试 --image /tmp/douyin-post/cover.png --mode image
scripts/douyin_web.mjs publish /tmp/douyin-post/post.json --browser default --direct
scripts/douyin_web.mjs close-browser --browser default
Workflow
- Run
detect-browserif the browser backend is unclear. - Run
loginonce for the selected browser backend. - Run
statusbefore important work if login state may have expired. - For real work, create a JSON plan and execute it with
run-planso search, browsing, collecting, commenting, liking, notification/message interaction, and publishing happen in one session. - For batch operations, use one plan or one long-lived command. Prefer built-in run artifacts over ad hoc logs; every run-plan writes manifest, step records, failure snapshots, and a final result.
- Finish with completed, unconfirmed, skipped, failed, and blocked counts plus relevant file paths. Launch-level failures also write a final result artifact before the command exits.
Result Style
- For single actions: report action, target, browser backend, and final observed status.
- For publishing: report post package path, media paths, browser backend, selected upload mode, and
published,blocked, orunconfirmedverification status. A direct publish exits nonzero unless Creator Center confirms publication. - For batch operations: summarize confirmed, unconfirmed, skipped, failed, and blocked counts first, then point to the local progress log.
- For SDK maintenance: report changed modules, compatibility impact, and validation commands.
What ships with it: 18 files
125.5 KB alongside SKILL.md, 11 of them executable
agents/
- openai.yaml363 B
references/
- content-publishing.md3.6 KB
- operation-plans.md6.3 KB
- sdk-architecture.md3.6 KB
- ui-workflows.md5.8 KB
scripts/
- douyin_image.pyruns9.4 KB
- douyin_package.pyruns5.5 KB
- douyin_web.mjsruns44.2 KB
- sdk/account_manager.mjsruns3.5 KB
- sdk/diagnostics.mjsruns4.1 KB
- sdk/douyin_feed_explorer.mjsruns5.5 KB
- sdk/interaction_actions.mjsruns7.6 KB
- sdk/plan_runner.mjsruns4.6 KB
- sdk/runtime_guard.mjsruns5.7 KB
- sdk_selftest.mjsruns6.9 KB
- sdk/task_artifacts.mjsruns2.8 KB
- .gitignore56 B
- README.md5.9 KB