| name | xhs |
| description | Capture and archive Xiaohongshu (小红书/RED) posts including videos, images, and text. Use when user shares a xiaohongshu.com link and wants to save, archive, analyze, or summarize the content. Supports video analysis via Gemini (optional). Triggers on phrases like "save this XHS link", "archive this xiaohongshu post", "analyze this video from xiaohongshu", or when a xiaohongshu.com URL is shared. |
Xiaohongshu (XHS) Capture Skill
Extracts and archives content from Xiaohongshu posts with a "Triple-Level Archive" strategy.
Quick Start
source skills/xhs/.env
python3 skills/xhs/scripts/xhs_bridge.py "https://www.xiaohongshu.com/explore/..."
python3 skills/xhs/scripts/xhs_archive.py xhs_last_run.json
python3 skills/xhs/scripts/xhs_archive.py xhs_last_run.json --analyze
Environment Variables
| Variable | Required | Description |
|---|
XHS_COOKIE | Yes | Cookie string from logged-in browser session |
XHS_OUTPUT_DIR | No | Base output directory (default: ./xhs_captures) |
XHS_NOTES_DIR | No | Override notes directory (advanced) |
XHS_MEDIA_DIR | No | Override media directory (advanced) |
GEMINI_API_KEY | No | Enables video analysis via Gemini |
Workflow
- Trigger: User shares
xiaohongshu.com link
- Extract: Run
xhs_bridge.py → outputs xhs_last_run.json
- Archive: Run
xhs_archive.py → downloads media, creates note
- Analyze (optional): If user asks to "analyze the video" and
GEMINI_API_KEY is set, append Gemini analysis
Output Structure
# Default layout (public-friendly)
{XHS_OUTPUT_DIR}/
├── notes/
│ └── YYYY-MM-DD_Title.md # Insight note
└── media/
└── YYYY-MM/
├── ..._video.mp4 # Raw video
├── ..._img1.jpg # Images
└── ..._raw.json # Full metadata
# Advanced: override with XHS_NOTES_DIR + XHS_MEDIA_DIR
Analysis Modes
| Mode | Trigger Phrase | Requirement |
|---|
| Basic | "save this", "archive this" | XHS_COOKIE only |
| Full | "analyze this video", "what does this say" | XHS_COOKIE + GEMINI_API_KEY |
If GEMINI_API_KEY is not set, provide text-based analysis from the description/comments.
Cookie Setup
- Log in to xiaohongshu.com in browser
- Open DevTools (F12) → Network tab
- Refresh page, click any request
- Copy the
Cookie header value
- Set:
export XHS_COOKIE="..."