Wechat article downloader
Downloads WeChat Official Account (微信公众号) articles and converts to Markdown with local images. Supports single URL, batch file, search by account name via Sogou, or bulk download via WeChat API. Use when user mentions "download wechat article", "保存公众号文章", "下载公众号", "微信文章转markdown", "备份公众号", or provides mp.weixin.qq.com URLs.From its SKILL.md
npx -y skills add ar-gen-tin/wechat-article-downloaderAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.0 KB, 938 tokens by cl100k_base, as published. Nobody here has run it
WeChat Article Downloader
Downloads WeChat Official Account articles via Chrome CDP and converts to clean Markdown with locally saved images.
Script Directory
Agent Execution Instructions:
- Determine this SKILL.md file's directory path as
SKILL_DIR - Detect runtime: if
bunis available usebun, otherwise usenpx -y bun. Store as${BUN_X} - Script path =
${SKILL_DIR}/scripts/main.ts
Runtime Detection (one-time per session):
command -v bun >/dev/null 2>&1 && echo "bun" || echo "npx -y bun"
Run ${BUN_X} ${SKILL_DIR}/scripts/main.ts --help for full CLI options.
Preferences (EXTEND.md)
Check for user preferences (priority order):
test -f .wechat-article-downloader/EXTEND.md && echo "project"
test -f "$HOME/.wechat-article-downloader/EXTEND.md" && echo "user"
| Result | Action |
|---|---|
| Found | Read, parse, apply settings |
| Not found | Use defaults |
See references/config/preferences-schema.md for full schema.
Usage
Single Article
${BUN_X} ${SKILL_DIR}/scripts/main.ts "https://mp.weixin.qq.com/s/xxxx"
Custom Output Directory
${BUN_X} ${SKILL_DIR}/scripts/main.ts "https://mp.weixin.qq.com/s/xxxx" -o ./articles/
Search by Account Name (via Sogou)
${BUN_X} ${SKILL_DIR}/scripts/main.ts --search "公众号名称" --max 5
${BUN_X} ${SKILL_DIR}/scripts/main.ts --search "公众号名称" --list
Batch Download from URL List
${BUN_X} ${SKILL_DIR}/scripts/main.ts urls.txt -o ./backup/
Download from Own Account (API)
Requires WeChat Official Account API credentials (see Environment Variables):
${BUN_X} ${SKILL_DIR}/scripts/main.ts --account --list
${BUN_X} ${SKILL_DIR}/scripts/main.ts --account -o ./my-articles/
${BUN_X} ${SKILL_DIR}/scripts/main.ts --account --max 20
Download Modes
| Mode | Trigger | Behavior |
|---|---|---|
| Single URL | Pass a mp.weixin.qq.com URL | Download one article via CDP |
| Batch file | Pass a .txt file path | Download all URLs sequentially |
| Search | --search "name" | Find articles via Sogou, then download |
| Account | --account flag | List + download all via WeChat API |
| Wait | --wait flag | Open Chrome, user logs in, press Enter to capture |
Output Format
YAML frontmatter + Markdown body:
---
title: "Article Title"
author: "Author Name"
date: "2024-01-15"
source_url: "https://mp.weixin.qq.com/s/xxxx"
description: "Article digest..."
captured_at: "2024-01-15T12:00:00.000Z"
---
Environment Variables
| Variable | Description |
|---|---|
WECHAT_DL_CHROME_PATH | Custom Chrome executable path |
WECHAT_DL_CHROME_PROFILE_DIR | Custom Chrome profile directory |
WECHAT_APP_ID | WeChat Official Account App ID (for --account mode) |
WECHAT_APP_SECRET | WeChat Official Account App Secret (for --account mode) |
API credentials can also be set in .wechat-article-downloader/.env or ~/.wechat-article-downloader/.env.
Troubleshooting
| Issue | Fix |
|---|---|
| Chrome not found | Install Chrome or set WECHAT_DL_CHROME_PATH |
| Timeout | Increase --timeout value |
| Login required | Use --wait mode |
| API errors | Check WECHAT_APP_ID and WECHAT_APP_SECRET |
| Images not loading | Page may need more scroll time; increase timeout |
| Sogou captcha | Try again later or use direct article URL |
What ships with it: 21 files
69.5 KB alongside SKILL.md, 11 of them executable
references/
scripts/
- batch.tsruns1.4 KB
- cdp.tsruns9.6 KB
- constants.tsruns799 B
- image-downloader.tsruns2.7 KB
- main.tsruns15.7 KB
- paths.tsruns807 B
- types.tsruns552 B
- wechat-api.tsruns4.2 KB
- wechat-extractor.tsruns3.6 KB
- wechat-search.tsruns4.7 KB
- wechat-to-markdown.tsruns3.4 KB
- bun.lock782 B
- CHANGELOG.md1.4 KB
- CHANGELOG.zh.md1.3 KB
- .gitignore332 B
- LICENSE1.1 KB
- package.json917 B
- README.en.md6.5 KB
- README.md6.7 KB