Skip to content

About

????????????? - Export WeChat Official Account articles to Markdown/HTML/PDF with one command

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wechat-export

微信文章导出工具 - 将微信公众号文章导出为 Markdown 或 HTML 格式

功能特性

  • 支持导出为 Markdown 和 HTML 两种格式
  • 自动下载并保存图片到本地(可选)
  • 支持自定义输出目录
  • 支持 HTTP 代理
  • 简洁的命令行界面
  • 完整的错误处理和提示

安装

# 使用 pip 安装
pip install wechat-export

# 或从源码安装
cd wechat-export
pip install -e .

使用方法

# 导出为 Markdown(默认)
wechat-export "https://mp.weixin.qq.com/s/xxx"

# 导出为 HTML
wechat-export "https://mp.weixin.qq.com/s/xxx" --format html

# 指定输出目录
wechat-export "https://mp.weixin.qq.com/s/xxx" --output ./my-articles

# 不保存图片
wechat-export "https://mp.weixin.qq.com/s/xxx" --no-images

# 使用代理
wechat-export "https://mp.weixin.qq.com/s/xxx" --proxy http://127.0.0.1:7890

# 批量导出
wechat-export "url1" "url2" "url3" --format html --output ./docs

命令行选项

  • URL: 微信公众号文章链接(支持多个)
  • --format, -f: 输出格式,markdown 或 html(默认: markdown)
  • --output, -o: 输出目录(默认: ./output)
  • --title: 自定义文件名标题
  • --save-images/--no-images: 是否保存图片到本地(默认: True)
  • --proxy: HTTP 代理地址
  • --embed-images: 将图片嵌入为 base64(仅 HTML 格式)

开发

# 安装开发依赖
pip install -e ".[dev]"

# 运行测试
pytest tests/

# 代码格式化
black src/

依赖

  • click >= 8.0
  • rich >= 13.0
  • requests >= 2.28
  • beautifulsoup4 >= 4.12
  • markdownify >= 0.11

⚠️ 免责声明

本工具仅供个人学习交流使用,请勿用于商业目的或未经授权的传播。

导出内容的版权归属原作者,请尊重原创作者的知识产权。

使用本工具导出文章即表示您同意上述条款。

License

MIT

About

????????????? - Export WeChat Official Account articles to Markdown/HTML/PDF with one command

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages