무료GitHub에 공개
wechat-to-md
Convert WeChat Official Account (微信公众号) articles to clean Markdown files with locally downloaded images.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기포함된 파일(15)
- SKILL.md2.6 KB
- .gitignore88 B
- main.py114 B
- mcp_server.py140 B
- README.md7.8 KB
- requirements.txt53 B
- wechat_to_md/__init__.py406 B
- wechat_to_md/cli.py7.6 KB
- wechat_to_md/converter.py4.2 KB
- wechat_to_md/downloader.py3.3 KB
- wechat_to_md/errors.py455 B
- wechat_to_md/mcp_server.py4.5 KB
- wechat_to_md/parser.py6.5 KB
- wechat_to_md/scraper.py3.1 KB
- wechat_to_md/utils.py3.1 KB
SKILL.md(원문)
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
WeChat Article to Markdown Converter
What this tool does
Converts WeChat public account articles into clean Markdown files with:
- YAML frontmatter (title, author, date, source URL)
- Locally downloaded images
- Preserved code blocks with language detection
- Audio/video reference extraction
- Clean formatting (no WeChat UI noise)
Prerequisites
- Python 3.10+
- Install dependencies:
pip install -r requirements.txt - Camoufox browser will be auto-downloaded on first run
Usage
CLI (single article)
python main.py "https://mp.weixin.qq.com/s/ARTICLE_ID"
CLI (batch from file)
python main.py -f urls.txt -o ./output -v
CLI Options
| Flag | Description |
|---|---|
-f FILE | Text file with URLs (one per line) |
-o DIR | Output directory (default: ./output) |
-c N | Image download concurrency (default: 5) |
--no-images | Skip image download, keep remote URLs |
--no-headless | Show browser (for solving CAPTCHAs) |
--force | Overwrite existing output |
--no-frontmatter | Use blockquote metadata instead of YAML |
-v | Verbose/debug logging |
MCP Server
Run as an MCP server for AI tool integration:
python mcp_server.py
Exposes two tools:
convert_article(url, output_dir, download_images, concurrency, use_frontmatter)— Convert a single articlebatch_convert(urls, output_dir, download_images, concurrency)— Convert multiple articles
MCP Configuration (for claude_desktop_config.json or similar)
{
"mcpServers": {
"wechat-to-md": {
"command": "python",
"args": ["mcp_server.py"],
"cwd": "<path-to-this-project>"
}
}
}
Output Structure
output/
<article-title>/
<article-title>.md # Markdown file with YAML frontmatter
images/
img_001.png
img_002.jpg
...
Common Issues
- CAPTCHA/verification page: Run with
--no-headlessto manually solve the CAPTCHA in the browser window, then retry. - Empty content: WeChat may rate-limit requests. Wait a few minutes and try again.
- Image download failures: Failed images keep their remote URLs in the markdown. Re-run with
--forceto retry.
Limitations
- Only supports articles from
mp.weixin.qq.com - Requires a working internet connection and the ability to run a headless browser
- WeChat may block automated access; Camoufox helps evade detection but is not guaranteed
리뷰
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
댓글
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.