Install
openclaw skills install wechat-article-assistant微信公众号文章同步与详情抓取助手。支持公众号后台登录、搜索与添加公众号、同步文章列表、抓取单篇或单账号文章详情、下载文章图片、配置代理、导出最近文章汇总和 Markdown 报告。用于“查最近文章”“抓文章详情”“下载公众号文章图片”“同步指定公众号文章”“按账号导出汇总”等场景。
openclaw skills install wechat-article-assistant使用这个 skill 时,按这里写的流程执行,不要跳过上游步骤,也不要自己用别的方法替代。
先读这个 skill,再执行操作
公众号文章详情优先使用 skill 自带命令
article-detailfetch-account-details没拿到图片,就视为流程异常
详情抓取遇到环境异常页时,优先检查代理
proxy-show,必要时 proxy-set,再重试。当前主要处理这些事:
python scripts/wechat_article_assistant.py --help
python scripts/wechat_article_assistant.py list-accounts --json
python scripts/wechat_article_assistant.py recent-articles \
--hours 48 \
--limit 20 \
--json
适合:
python scripts/wechat_article_assistant.py list-account-articles \
--nickname "集虚空间" \
--count 20 \
--json
也可以用 --fakeid 指定账号。
可选参数:
--begin--count--keyword--remote--save适合:
这是最容易漏写、但最关键的部分。
当你已经有文章链接,或者已经知道 aid 时,用 article-detail。
python scripts/wechat_article_assistant.py article-detail \
--link "https://mp.weixin.qq.com/s/xxxx" \
--download-images true \
--save true \
--json
或者:
python scripts/wechat_article_assistant.py article-detail \
--aid "2247484413_1" \
--download-images true \
--save true \
--json
article-detail 关键参数--aid--link--download-images--include-html--force-refresh--save--json当你已经知道公众号,但还没逐篇抓详情,用 fetch-account-details。
python scripts/wechat_article_assistant.py fetch-account-details \
--nickname "集虚空间" \
--limit 5 \
--download-images true \
--save true \
--json
或者:
python scripts/wechat_article_assistant.py fetch-account-details \
--fakeid "Mzk3NTM3NTQ0MA==" \
--limit 5 \
--download-images true \
--save true \
--json
fetch-account-details 关键参数--fakeid--nickname--limit--download-images--include-html--force-refresh--save--export-markdown--include-report-markdown--report-title--jsonarticle-detailfetch-account-details推荐至少加:
--download-images true --save true
判断标准:
python scripts/wechat_article_assistant.py proxy-show --json
python scripts/wechat_article_assistant.py proxy-set \
--url "http://127.0.0.1:7890" \
--enabled true \
--apply-article-fetch true \
--apply-sync true \
--json
proxy-set 关键参数--url--enabled--apply-article-fetch--apply-sync--urls--json如果抓详情时出现类似错误:
微信返回环境异常校验页,请配置代理后重试文章详情抓取
就先:
proxy-showproxy-setarticle-detail / fetch-account-detailspython scripts/wechat_article_assistant.py set-account-config \
--fakeid "FAKEID" \
--processing-mode sync_and_detail \
--categories "学习主题" \
--auto-export-markdown true \
--json
python scripts/wechat_article_assistant.py sync --fakeid "FAKEID" --json
python scripts/wechat_article_assistant.py sync-all \
--interval-seconds 180 \
--channel feishu \
--target user:ou_xxx \
--account support \
--json
sync-all 通知参数sync-all 当前已经支持:
--channel--target--account这三个参数用于同步过程中的进度通知。
sync-all 当前通知行为如果同时传入了 channel/target/account,同步过程中会通过 openclaw message send 发送通知。
示例文案:
xxx公众号完成,进度1/4。状态:成功;新增文章 3 篇。
如果该公众号同步失败,则会发送:
xxx公众号完成,进度1/4。状态:失败;原因:具体错误。
sync-all 在开始前会先验证登录状态。
如果一开始就发现登录已过期:
channel/target/account 发送过期提醒如果在同步某个公众号过程中发现登录已过期:
当前登录过期提醒文案类似:
xxx公众号同步失败,进度1/4。检测到公众号登录已过期,已停止后续同步,请重新扫码登录公众号后台。
每个公众号可设置:
processing_mode=sync_only
processing_mode=sync_and_detail
还可以设置:
auto_export_markdown=truepython scripts/wechat_article_assistant.py export-recent-report \
--hours 24 \
--save true \
--include-markdown false \
--only-markdown-accounts true \
--json
python scripts/wechat_article_assistant.py export-account-report \
--fakeid "FAKEID" \
--save true \
--include-markdown false \
--json
auto_export_markdown=true 的公众号为了避免中文和特殊字符出现在文件名里:
YYYYMMDD-HHMMSS_combined-report.mdYYYYMMDD-HHMMSS_account-report_<fakeid>.mdarticle_<aid>.mdpython scripts/wechat_article_assistant.py recent-articles \
--hours 48 \
--limit 20 \
--json
python scripts/wechat_article_assistant.py article-detail \
--link "https://mp.weixin.qq.com/s/xxxx" \
--download-images true \
--save true \
--json
如果失败且提示环境异常:
python scripts/wechat_article_assistant.py proxy-show --json
python scripts/wechat_article_assistant.py proxy-set \
--url "http://127.0.0.1:7890" \
--enabled true \
--apply-article-fetch true \
--apply-sync true \
--json
然后再重试 article-detail。
python scripts/wechat_article_assistant.py fetch-account-details \
--nickname "集虚空间" \
--limit 5 \
--download-images true \
--save true \
--json
python scripts/wechat_article_assistant.py login-info --validate true --json
python scripts/wechat_article_assistant.py env-check --json
python scripts/wechat_article_assistant.py doctor --json
需要更细说明时再读:
references/operations.mdreferences/interface-reference.mdreferences/sqlite-schema.mdreferences/account-classification.md