Xiaohongshu Favorites
Use the scripts in scripts/ to pull your XHS saved notes and extract note text via Playwright (avoids re-implementing request signatures).
Cookie auth (recommended)
- •CookieCloud: set
COOKIECLOUD_UUID+COOKIECLOUD_PASSWORD(also acceptsCOOKIECLOUDUUID/COOKIECLOUDPASSWORD)- •Optional:
COOKIECLOUD_SERVER_URL(default:http://127.0.0.1:8088)
- •Optional:
- •Or set
XIAOHONGSHU_COOKIE(rawCookie:header string) - •Or pass
--cookie 'web_session=...; ...'to a script
Quick Start
Detect current profile id (best-effort):
bash
docker compose run --rm runner python skills/xiaohongshu-favorites/scripts/xhs_whoami.py
List saved notes (收藏):
bash
docker compose run --rm runner python skills/xiaohongshu-favorites/scripts/xhs_saved_notes.py --max 50 docker compose run --rm runner python skills/xiaohongshu-favorites/scripts/xhs_saved_notes.py --profile-id <profileId> --max 50
List saved boards (收藏专辑/收藏夹):
bash
docker compose run --rm runner python skills/xiaohongshu-favorites/scripts/xhs_boards.py --max 50 docker compose run --rm runner python skills/xiaohongshu-favorites/scripts/xhs_boards.py --profile-id <profileId> --max 50
List notes inside a board (note ids + xsec_token for detail fetch):
bash
docker compose run --rm runner python skills/xiaohongshu-favorites/scripts/xhs_board_items.py --board-id <boardId> --max 50
Fetch note details (plain text output by default):
bash
docker compose run --rm runner python skills/xiaohongshu-favorites/scripts/xhs_note_detail.py --url 'https://www.xiaohongshu.com/explore/<noteId>' # Some notes require an xsec_token (share token) to browse via web. # You can avoid shell-escaping `&` by passing it separately: docker compose run --rm runner python skills/xiaohongshu-favorites/scripts/xhs_note_detail.py --note-id <noteId> --xsec-token <xsec_token>
JSON mode (for piping / automation):
- •Add
--jsonto any script.
Video Notes: Get A Transcript
If the saved item is a video note and the user asks “这个视频讲了什么 / 给我逐字稿”:
- •Download audio via
skills/media-audio-download(pass--note-id+--xsec-tokenwhen required). - •Transcribe via
skills/whisper-transcribe-docker(local, Docker).
Troubleshooting
- •Headless/captcha issues:
- •Re-run with
--no-headlessso you can see and complete any challenges.
- •Re-run with
- •404 / "当前笔记暂时无法浏览" / missing note data:
- •Many notes require
xsec_token(share token). Get it fromxhs_saved_notes.pyoutput and rerunxhs_note_detail.py --note-id ... --xsec-token ....
- •Many notes require
- •"Failed to detect profile id":
- •Pass
--profile-idexplicitly (copy from the URL:/user/profile/<id>).
- •Pass
- •"Failed to extract note data":
- •Cookies likely expired; re-sync CookieCloud.
- •XHS page structure may have changed; see
references/research.mdfor the fallback plan (network interception).
Notes
- •Playwright uses
--channel chromeby default to reuse your installed Chrome (avoids downloading browsers). In Docker, the channel may not exist; the scripts fall back to bundled Chromium.