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
Release files for wechat2md 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wechat2md-0.1.0.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wechat2md-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.6 kB
Release files / wechat2md-0.1.0.tar.gz
| Download URL | wechat2md-0.1.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a305b729f741240674a3f703c44159baf4c728952f4cbbba7adbe9ae1780a556
|
|
BLAKE2b-256 checksum How to use checksums |
966b992c62ff10242202f6517384f6aeb108255b0875729cb1893a5a14c7346b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / wechat2md-0.1.0-py3-none-any.whl
| Download URL | wechat2md-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a8076dc2db2ba68d8f411918af6798c17609a79dc8dad12ff31325af98472af
|
|
BLAKE2b-256 checksum How to use checksums |
f9d3bd9c1e0c880b2b628e769230dd15a936f6c573962953d40f034fa7f68f16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|