tool_publish_csdn
Send local markdown drafts to CSDN's draft box or publish them directly via browser automation. Requires a saved login session and enforces rate limits.
Instructions
Send a local draft to CSDN via browser automation (Plan A).
By default (as_draft=True) saves the article to CSDN's online 草稿箱 (draft box) WITHOUT publishing — you then review it in the browser and publish manually. Set as_draft=False to publish directly (public immediately, returns the article URL).
Fills the CSDN markdown editor: title, body, tags, category, visibility, then clicks 存草稿 or 发布文章. Direct publish enforces a rate limit (default 2/day, min 30 min apart) to avoid anti-automation flags; saving drafts is not rate-limited.
Requires a saved session — call csdn_login first. If the session expired, returns needs_login=True so you can re-run csdn_login.
WARNING: This drives CSDN's web UI. Selectors may break when CSDN changes its editor; a screenshot is saved on failure to help diagnose. Respect CSDN's terms — keep frequency low and content genuine.
Args: file_path: Absolute path to the draft .md file (from write_blog). tags: Override tags from the draft's front-matter (3-5 recommended). category: Override CSDN category (e.g. "后端"). visibility: Override visibility — "public", "private", or "fans" (only meaningful when as_draft=False). as_draft: True (default) = save to CSDN draft box, not public. False = publish directly and return the article URL. headless: Run headless (default True). Set False to watch the action. timeout_ms: Per-action timeout in milliseconds. skip_rate_limit: Bypass the rate limit (use with care — risks a ban). Only applies when as_draft=False.
Returns: dict with {ok, as_draft, message, title, draft_manage_url?, article_url?, screenshot?, needs_login?}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| as_draft | No | ||
| category | No | ||
| headless | No | ||
| file_path | Yes | ||
| timeout_ms | No | ||
| visibility | No | ||
| skip_rate_limit | No |