Wechat Article Export

v1.1.0

Export WeChat public account articles as mobile long screenshots (PNG), PDFs, or high-quality Markdown with YAML frontmatter and code block support.

0· 173·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for benzking/wechat-article-export.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Wechat Article Export" (benzking/wechat-article-export) from ClawHub.
Skill page: https://clawhub.ai/benzking/wechat-article-export
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install wechat-article-export

ClawHub CLI

Package manager switcher

npx clawhub@latest install wechat-article-export
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description (WeChat article export) align with the included code and instructions: Playwright is used to render mp.weixin.qq.com pages, capture long screenshots, convert to PDF, and produce Markdown. Required packages listed in SKILL.md (playwright, bs4, markdownify, requests, Pillow) match the implementation needs.
Instruction Scope
SKILL.md confines the agent to running the Python script (no arbitrary shell commands) and shows CLI and Python APIs for exporting articles. The script performs network navigation (page.goto), downloads images, and writes output files — all expected for this task. However the provided script was truncated in the listing, so later code paths (e.g., any network callbacks, telemetry, or external uploads) were not visible; this reduces certainty.
Install Mechanism
No platform install spec is included (instruction-only), but SKILL.md instructs installing Playwright and running 'playwright install chromium', which will download a browser binary from the internet; this is expected for a browser-automation exporter but is an external download step users should be aware of.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The operations (web scraping of public mp.weixin.qq.com pages and local file writes) do not require secrets, so the lack of requested credentials is proportionate.
Persistence & Privilege
always is false and the skill does not request to modify other skills or system-wide settings. It runs as an on-demand script and stores output files in the filesystem as expected.
Assessment
This skill appears coherent for exporting WeChat articles and does not ask for credentials. Before installing/run: (1) review the full wechat_export.py file (the public listing here was truncated) to ensure there are no hidden network uploads or telemetry; (2) be aware that 'playwright install chromium' will download a browser binary — run it in a trusted/sandboxed environment if you have concerns; (3) if you plan to run the skill under an agent with autonomous invocation, consider limiting the agent's filesystem scope or running it manually the first time to verify outputs; and (4) if you need higher assurance, request the complete source or run the script in an isolated container to inspect network activity and filesystem writes.

Like a lobster shell, security has layers — review code before you run it.

latestvk97cp7mh03tfbjzad087je40mn84nt7r
173downloads
0stars
3versions
Updated 2w ago
v1.1.0
MIT-0

微信公众号多功能导出工具

集成長截圖、PDF、Markdown 三種導出方式於一體,根據需要自由選擇。

upported Formats 支持格式

格式說明
screenshot移動端長截圖(PNG),3x DPR,自動拼接,隱藏底部工具欄
pdfPDF 文檔(基於截圖轉換)
markdown高質量 Markdown,含 YAML frontmatter、代碼塊、圖片

觸發方式

  • 「導出微信文章」
  • 「公眾號截圖」
  • 「文章轉PDF」
  • 「文章轉Markdown」
  • 「微信導出」
  • 收到 mp.weixin.qq.com 連結

導出格式組合示例

# 全部格式
-f all

# 僅截圖
-f screenshot

# 僅 Markdown
-f markdown

# 截圖 + PDF
-f screenshot,pdf

# 三種都要
-f screenshot,pdf,markdown

執行命令

方式一:CLI(直接指定格式)

# 全部導出
python3 /path/to/wechat_export.py "<URL>" -f all -o /workspace/output

# 指定格式導出
python3 /path/to/wechat_export.py "<URL>" -f screenshot -o /workspace/output
python3 /path/to/wechat_export.py "<URL>" -f markdown -o /workspace/output
python3 /path/to/wechat_export.py "<URL>" -f screenshot,pdf -o /workspace/output

# Markdown 不下載圖片(保留遠程 URL)
python3 /path/to/wechat_export.py "<URL>" -f markdown --no-images -o /workspace/output

# Markdown 不含 YAML frontmatter
python3 /path/to/wechat_export.py "<URL>" -f markdown --no-frontmatter -o /workspace/output

方式二:Python 函數調用(推薦 Agent 內嵌使用)

import sys
sys.path.insert(0, "/path/to/scripts")
from wechat_export import export_wechat_article

# 導出全部格式
result = await export_wechat_article(
    "https://mp.weixin.qq.com/s/xxxxx",
    formats=["screenshot", "pdf", "markdown"],  # 可任選
    output_dir="/workspace/output",
    download_imgs=True,    # Markdown 是否下載圖片
    no_frontmatter=False,   # Markdown 是否含 frontmatter
)

# result 包含:
# {
#     "title": "文章標題",
#     "url": "https://...",
#     "screenshot_path": "/path/to/xxx.png",   # or None
#     "pdf_path": "/path/to/xxx.pdf",          # or None
#     "markdown_path": "/path/to/xxx.md",     # or None
#     "error": None or "錯誤信息",
# }

依賴

pip install playwright beautifulsoup4 markdownify requests Pillow
playwright install chromium

輸出目錄結構

<OUTPUT_DIR>/
└── <Article_Title>/
    ├── <Article_Title>-20260410.png    # 長截圖(如選)
    ├── <Article_Title>-20260410.pdf    # PDF(如選)
    └── <Article_Title>.md              # Markdown(如選)
        └── images/
            ├── img_000.png
            └── img_001.jpg

核心功能亮點

長截圖 (screenshot)

  • 移動端視圖(393×852,3x DPR)
  • 智能滾動觸發懶加載圖片
  • 隱藏底部工具欄、干擾元素
  • 15% 重疊拼接,消除接縫
  • 深度反檢測偽裝

PDF (pdf)

  • 自動基於截圖轉換
  • RGBA / P 模式自動墊白底
  • 分辨率 100 DPI

Markdown (markdown)

  • YAML frontmatter(元數據)
  • 30+ 微信噪聲元素深度移除
  • 代碼塊識別 25+ 語言
  • 富文本優化(標題/列表/引用)
  • 圖片可選本地下載或保留遠程 URL
  • 多線程並發下載(5 線程,2 次重試)

Changelog

v1.1.0 (2026-04-11)

修复:

  • 修复 URL 验证逻辑:/s/parsed.path.startswith("/s"),支持临时分享链接(路径为 /s 而非 /s/
  • 截图前自动关闭并隐藏「此为临时链接」横幅(.rich_media_global_msg_inner / #preview_bar),避免横幅在每个分段重复出现
  • 将横幅元素加入 NOISE_SELECTORS 黑名单

Comments

Loading comments...