← 返回
未分类

Wechat Article For Ai

Convert WeChat Official Account (微信公众号) articles to clean Markdown files with locally downloaded images.
Convert WeChat Official Account (微信公众号) articles to clean Markdown files with locally downloaded images.
soar999 soar999 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 396
下载
💾 4
安装
1
版本
#latest

概述

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

FlagDescription
-------------------
-f FILEText file with URLs (one per line)
-o DIROutput directory (default: ./output)
-c NImage download concurrency (default: 5)
--no-imagesSkip image download, keep remote URLs
--no-headlessShow browser (for solving CAPTCHAs)
--forceOverwrite existing output
--no-frontmatterUse blockquote metadata instead of YAML
-vVerbose/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 article
  • batch_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-headless to 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 --force to 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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 04:32 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

office-efficiency

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 932 📥 187,315
office-efficiency

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 464 📥 154,996
office-efficiency

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 387 📥 147,318