Skip to main content

微信公众号文章转 Markdown CLI 工具

Project description

wechat2md

微信公众号文章转 Markdown CLI 工具。

安装

pip install wechat2md

使用

# 基本用法
wechat2md https://mp.weixin.qq.com/s/xxxxx

# 指定输出目录
wechat2md https://mp.weixin.qq.com/s/xxxxx -o ./articles

# 指定文件名
wechat2md https://mp.weixin.qq.com/s/xxxxx -f my_article.md

# 使用隐秘模式(遇到反爬时)
wechat2md https://mp.weixin.qq.com/s/xxxxx --stealth

作为库使用

from wechat2md import fetch_article, html_to_markdown

# 抓取文章
article = fetch_article('https://mp.weixin.qq.com/s/xxxxx')
print(article['title'])

# 转换 HTML 为 Markdown
md = html_to_markdown(article['content'])

选项

选项 说明
-o, --output-dir 输出目录 (默认: ./data)
-f, --filename 输出文件名 (默认: 使用文章标题)
-s, --stealth 使用隐秘模式绕过反爬
-V, --version 显示版本号

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wechat2md-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wechat2md-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file wechat2md-0.1.0.tar.gz.

File metadata

  • Download URL: wechat2md-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for wechat2md-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a305b729f741240674a3f703c44159baf4c728952f4cbbba7adbe9ae1780a556
MD5 16979aa0695c587d9d70ec7c7432e1ef
BLAKE2b-256 966b992c62ff10242202f6517384f6aeb108255b0875729cb1893a5a14c7346b

See more details on using hashes here.

File details

Details for the file wechat2md-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wechat2md-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for wechat2md-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a8076dc2db2ba68d8f411918af6798c17609a79dc8dad12ff31325af98472af
MD5 6139f3e7067c5c0f8f9bc73f45c65133
BLAKE2b-256 f9d3bd9c1e0c880b2b628e769230dd15a936f6c573962953d40f034fa7f68f16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page