In the DSH ecosystem, integrating social media data (such as favorites) into agent workflows typically requires writing scraper scripts. The dsh-favorites-digest plugin provides a more direct solution by reusing logged-in browser sessions. It can organize personal favorites from Douyin and Xiaohongshu into Markdown documents and optionally generate LLM summaries.
This is a DSH plugin maintained by kittimzhe. It supports exporting your Douyin and Xiaohongshu web favorites to Markdown (including topic grouping), supports generating summaries via LLM, and reuses logged-in Playwright/Chrome sessions.
Core Features¶
- Export favorites to Markdown.
- Support for Douyin and Xiaohongshu.
- Optional LLM summaries (OpenAI/DeepSeek compatible).
- Reuse logged-in Playwright/Chrome sessions.
Installation and Prerequisites¶
The following conditions must be met before installation:
* Node.js version 20 or 22.
* The Harness profile must have the commands and sessionQuery services mounted (the official web / agent profiles include these by default).
Run the following commands to install the plugin:
dsh plugin --profile web add dsh-favorites-digest
npx playwright install chromium
For local development or debugging, you can use an absolute path link:
dsh plugin --profile web add link:/absolute/path/to/dsh-favorites-digest
Typical Usage¶
In any DSH session, use the following commands:
-
Login Session:
/favorites login -
Export Favorites:
/favoritesor/favorites run
(IfOPENAI_API_KEYorDEEPSEEK_API_KEYis set, LLM summaries will be generated automatically) -
Specify Platform:
/favorites --platform xiaohongshu -
Limit Number of Items Scraped per Site:
/favorites --limit 50 -
Connect to Remote Logged-in Chrome:
/favorites --cdp-url http://127.0.0.1:9222 -
Specify Output Directory:
/favorites --out /path -
Collect Only (Skip Summary Generation):
/favorites --no-llm -
Collect Only (Skip File Writing):
/favorites collect
Advanced Usage: As an Agent Tool¶
To use it in an agent, you need to enable exposeTool in the profile configuration:
- insert:
- id: favorites-digest
name: dsh-favorites-digest
config:
exposeTool: true
Use Cases and Notes¶
- Target Audience: Developers who need to archive personal social media favorites (Douyin, Xiaohongshu) to Markdown documents or integrate them into Agent workflows.
- Important Restriction: Do not use this plugin on accounts that do not belong to you.
- File Location: Exported Markdown and JSON files are generated at
<session cwd>/dsh-favorites/favorites-<timestamp>.md. - Browser Cache: The browser profile is stored in
~/.dsh/favorites-digest/profile. - Debugging: The scraping logic relies on page list JSON and visible cards. If website revisions or CAPTCHAs occur, they must be resolved manually in the opened window.
This plugin simplifies the process of personal media archiving by reusing sessions and integrating LLMs. For more details, please visit the GitHub repository.