| name | wechat-article-download |
| description | Download WeChat public account articles as clean Markdown files. Use when the user wants to save a WeChat article (from mp.weixin.qq.com) as a markdown document with images saved locally. Triggers on requests like "download this WeChat article", "save article as markdown", "extract article from WeChat link", or any mp.weixin.qq.com URL. |
WeChat Article Downloader
Download WeChat public account articles and convert them to Markdown with locally-saved images.
Quick Start
cd ~/.claude/projects/skills/wechat-article-download/scripts
npm install
node download.mjs <wechat-url> --output <dir> [--auth-key <key>]
How It Works
- Fetch — Sends the WeChat article URL to the
mptext.top API, which returns the raw HTML
- Parse — Extracts title, author, and date from the HTML using regex patterns
- Download Images — Finds all
mmbiz.qpic.cn image URLs in the HTML, downloads them to images/, and rewrites URLs to local paths
- Convert — Uses Turndown with GFM plugin to convert HTML to Markdown
- Save — Writes
article.md and images/ folder inside a directory named after the article title
Output Structure
<output-dir>/
└── <article-title>/
├── article.md # Markdown with local image references
└── images/ # Downloaded image files
API Key
The mptext.top API may require an auth key. If the download fails without a key, the user should:
- Visit https://mptext.top to obtain an API key
- Pass it via
--auth-key <key>
Error Handling
- Invalid URL format →
Invalid WeChat article URL. Expected format: https://mp.weixin.qq.com/s/...
- API errors →
Failed to download article: <error message>
- Failed image downloads → Skipped silently, URLs remain unchanged in markdown
Dependencies
The download.mjs script requires these npm packages:
ofetch — HTTP client
turndown — HTML to Markdown converter
turndown-plugin-gfm — GitHub Flavored Markdown support
Install them with: npm install inside the scripts/ directory.