- Home
- Plugins
- Sessions & Messages
- dsh-favorites-digest
dsh-favorites-digest
kittimzhe/dsh-favorites-digest
DeepSeek Harness plugin: /favorites exports your own Douyin and Xiaohongshu web collections to Markdown using a logged-in browser session
Install
dsh plugin --profile web add github:kittimzhe/dsh-favorites-digestREADME
dsh-favorites-digest
中文 | English
A DeepSeek Harness plugin that exports your own Douyin and Xiaohongshu web favorites into Markdown (topic groups + optional LLM digest). It reuses a logged-in Playwright / Chrome session. Do not use it on anyone else's account.
Compliance — read first
This is a personal backup tool, not a scraper service. Keep it that way:
- Your own account, your own data. Export only favorites from an account you logged into yourself (QR scan). Never point it at other people's accounts or data.
- Respect the platforms. Automated access may violate Douyin / Xiaohongshu terms of service even for your own data. Risk control may throttle or ban your account — that risk is yours; the tool works from your own logged-in session and solves no captchas for you.
- No commercial use, no redistribution. Exported content belongs to its original authors. Keep outputs for personal reference; do not resell, republish, or bulk-redistribute them.
- Nothing leaves your machine. Collection, artifacts, and digests all run and stay locally.
Install
Requires Node.js 20 or 22 and a Harness profile that mounts the commands and sessionQuery services (the official web / agent profiles do).
dsh plugin --profile web add dsh-favorites-digest
npx playwright install chromium
Local checkout:
dsh plugin --profile web add link:/absolute/path/to/dsh-favorites-digest
Then in any session:
/favorites login
/favorites
Files land in <session cwd>/dsh-favorites/favorites-<timestamp>.md (and .json). The browser profile is stored at ~/.dsh/favorites-digest/profile.
Commands
| Input | Result |
|---|---|
/favorites login | Open Douyin + Xiaohongshu and wait until the web session is logged in |
/favorites / /favorites run | Collect + write Markdown/JSON (LLM digest if an API key is set) |
/favorites collect | Collect only (still writes the Markdown catalog, no LLM call) |
/favorites digest | Rebuild Markdown from the latest JSON in the output dir |
/favorites --platform xiaohongshu | One site |
/favorites --limit 50 | Cap per site (debug) |
/favorites --likes | Also export Douyin 喜欢 |
/favorites --cdp-url http://127.0.0.1:9222 | Attach to an already-logged-in Chrome |
/favorites --no-llm | Skip the digest section |
/favorites --out /path | Output directory |
Same as other ctx.commands handlers: results stay off the model transcript (zero tokens).
Optional model tool
Off by default. Set exposeTool: true on the plugin row to register favorites_digest for the agent.
- insert:
- id: favorites-digest
name: dsh-favorites-digest
config:
exposeTool: true
Optional LLM digest
If OPENAI_API_KEY or DEEPSEEK_API_KEY is set, /favorites run appends an AI 综述 section. Compatible OpenAI-style bases work via OPENAI_BASE_URL / OPENAI_MODEL. Topic grouping still works with no key.
Open-source project identification
run/digest also scan titles and descriptions for open-source projects — explicit github.com/<owner>/<repo> links plus dashed/camelCase names like open-code-review or Windows-MCP — and verify them against the GitHub search API, so the Markdown gains a 开源项目 section with repo, star count and which favorite mentioned it. Anonymous GitHub search is rate-limited (10 req/min), so at most 8 candidates are checked with spacing and the step degrades silently on 403. Set identifyProjects: false to turn it off; digest re-renders the stored list without re-querying.
How collection works
- Open the logged-in 收藏 surfaces (Xiaohongshu profile → 收藏 → 笔记; Douyin
/user/self?showTab=favorite_collection). - Listen to the page's own list JSON and scrape visible cards.
- Scroll until the count stops growing.
Site redesigns can break selectors. Captchas must be solved in the opened window.
Troubleshooting
collectaborts with 未登录 — login detection uses hard signals (Douyinsessionidcookie; Xiaohongshu avatar-vs-登录-button probe). An abort means the session really is not logged in: re-run/favorites loginand scan both QR codes; it only reports success after both platforms are confirmed.- Xiaohongshu shows “IP 存在风险” (error 300012) during login — XHS risk control can block QR login from automated browsers on some networks. Log in inside a Chrome you launched yourself, then attach:
Chrome ≥136 refuses"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \ --user-data-dir="$HOME/.dsh/favorites-digest/cdp" --remote-debugging-port=9222 # then: /favorites --cdp-url http://127.0.0.1:9222--remote-debugging-porton the default profile, so the dedicated--user-data-diris required. - CDP attach fails with “Browser context management is not supported” — Chrome 154 removed the browser-level CDP calls older Playwright issued at attach time; requires
playwright≥ 1.64. - Why hard-fail when not logged in? Logged-out collection used to silently export the recommendation feed as your “favorites”. It now aborts instead of fabricating data.
- Running the TS sources with Node type stripping fails (
parameter property is not supported in strip-only mode) — expected; the sources target the bundler. Usenpm run bundleoutput (lib/), which is what the published plugin runs.
Development
npm ci
npx playwright install chromium
npm run typecheck
npm test
npm run bundle
Related plugins
dsh-web-ui (dsh-chat-recovery)
zhu1090093659/dsh-web-ui
billion-context
ranxianglei/billion-context
dsh-synapse
liangmianya/dsh-synapse
dsh-chat-import
nwflower/dsh-chat-import