labali-weibo-download-user-posts
Treat this skill as a layered system, not a single script.
Layer Contract
SKILL.md(this file) is the policy layer.- Define goals, constraints, success criteria, and decision boundaries.
- Stay semantic and stable across UI changes.
references/architecture.mdis the strategy layer.- Define execution model, failure handling, and quality standards.
scripts/*.tsis the execution layer.- Scripts are execution assets, not the skill definition itself.
- Use persistent browser profile for manual-login reuse.
- Keep extraction and downloading logic modular and replaceable.
Required Constraints
- Use browser automation only.
- Do not use private/undocumented Weibo APIs.
- Reuse manual-login session via unified Chrome CDP startup:
open -na "Google Chrome" --args --remote-debugging-port=9223 --user-data-dir="$HOME/.chrome-labali-no-proxy" --no-proxy-server. - Prefer semantic extraction from visible page state and loaded resources.
- Download target user's timeline posts and assets (text, images, optional videos).
- Export metadata files:
posts.json,user.md, and per-postpost.md. - Keep partial success: keep downloaded files even if some URLs fail.
NEVER
- Never delete or discard partially downloaded files on URL failure — keep all successfully downloaded content.
- Never report success unless at least one post was extracted and the output folder was created with
posts.jsonanduser.md. - Never report success based on action completion alone — verify the output folder and metadata files exist.
Success Criteria
A run is successful only when all conditions hold:
- A user output folder is created under target local directory.
- Folder naming format is
<timestamp>-<user_slug>. posts.jsonanduser.mdare generated.- At least one post is extracted from timeline.
- Per-post folders contain
post.mdand downloaded media when available. - URL output and logs retain canonical user URL form.
Runtime Inputs
Use skill.yaml as the source of truth for input schema.
Operational Mode
- Default mode: guided browser flow + semantic extraction + authenticated media download.
- Startup guidance:
- launch/reuse Chrome by the unified
open -na "Google Chrome"CDP command, - connect via CDP port,
- open target user page,
- check login status,
- if required, guide user to complete manual login in the same window.
- launch/reuse Chrome by the unified
- Input guidance:
- if
user_urlis missing, prompt interactively, - if
output_diris missing, prompt interactively with default.
- if
- Pagination guidance:
- scroll timeline,
- click visible expansion controls,
- stop when no more content appears or explicit end markers are present.
If failure handling or extraction decisions are unclear, load
references/architecture.md. If extraction strategy for a specific content type is unclear, loadreferences/plan.md.
Resources
- Architecture and standards:
references/architecture.md - Workflow map and extraction plan:
references/plan.md - Shared runtime and downloader helpers:
scripts/core.ts - Main orchestration:
scripts/executor.ts - CLI entry:
scripts/run.ts - Regression checks:
tests/test_regression.sh