SuperAPI AI Directory

xhs-batch

General & other

View repository

Updated 10-15 17:33

About this skill

The user wants to batch extract multiple Xiaohongshu posts. Please proceed as follows:

Constant definitions

  • Cookies file: ~/cookies.json
  • Obsidian save directory: ~/Documents/Obsidian Vault/xhs
  • Whisper model: mlx-community/whisper-large-v3-turbo

Input

List of links provided by the user: $ARGUMENTS

Process

Step 1: Parse links

Extract all Xiaohongshu links from the input (supports multiple lines, space-separated, comma-separated). For each link, extract the post ID and xsec_token.

Step 2: Check Cookies

Check whether ~/cookies.json exists. If it does not exist, follow /xhs step 0 to guide the user through exporting it.

Step 3: Extract one by one

For each link, execute /xhs full extraction process (steps 2-4):

  • Request the page → parse INITIAL_STATE
  • For video posts, perform speech transcription
  • Organize in Peter Thiel style
  • Save as {YYYY-MM-DD} {短标题}.md

Leave a 3-second interval between each post to avoid triggering anti-scraping measures.

Step 4: Summary report

After everything is completed, output a brief summary:

  • Number of successes/failures
  • Each post's filename and one-sentence summary