npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-wechat-article-fetcher

v0.1.2

Published

DeepSeek Harness (DSH) plugin: complete WeChat Official Account article downloader — wechat_article_fetch tool plus a zero-dependency anti-bot fetcher CLI (title/time/author/content with text-images-videos-links, read/like/wow stats and comments with a lo

Readme

dsh-wechat-article-fetcher

English | 中文

npm GitHub License: MIT

DeepSeek Harness (DSH) 插件:从 URL 下载完整的 微信公众号文章——标题、作者、公众号、发布时间,以及按文字/图片/视频/链接结构化块的完整正文, 内置反爬保护。提供微信登录 cookie 时,还可获取阅读/点赞/在看数据与评论。

安装 → 会话里说一句"抓取这篇文章 <URL>" → 完成

可提取字段

| 字段 | 匿名访问 | 提供登录 cookie | |---|---|---| | 标题 / 作者 / 公众号名 / gh_id | ✅ | ✅ | | 发布时间(时间戳 + 显示格式) | ✅ | ✅ | | 摘要 / 封面 / 原文链接 / 专辑与标签 | ✅ | ✅ | | 内容块 — 文字 / 图片 / 视频 / 链接 | ✅ | ✅ | | 图片列表(mmbiz 地址,可下载) | ✅ | ✅ | | 视频 vid + 播放页(mp4 尽力解析) | ✅ | ✅ | | 阅读数 / 点赞 / 在看 | ❌ 微信不暴露 | ✅ | | 评论(含回复) | ❌ no session | ✅ |

❌ 行是微信平台限制(getappmsgext / appmsg_comment 接口拒绝匿名访问),并非插件缺陷。 登录 cookie 必须是文章页登录态wxuin + key + pass_ticket);公众号后台 cookie (slave_sid / data_ticket)对这两个接口无效(已实测验证)。

安装

dsh plugin --profile web add dsh-wechat-article-fetcher
# 或从本地目录安装:
dsh plugin --profile web add /path/to/dsh-wechat-article-fetcher

CLI 只转发 pnpm、不维护 bundles 列表,因此还需把包名加入 ~/.dsh/profiles/web/package.jsondsh.profile.bundles,然后重启 dsh web

{ "dsh": { "profile": { "bundles": [ "@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-wechat-article-fetcher" ] } } }

用法

在任意 DSH 会话中调用工具 wechat_article_fetcher

| 参数 | 类型 | 默认值 | 说明 | |---|---|---|---| | url | string | —(必填) | 文章链接;优先短链接 https://mp.weixin.qq.com/s/xxxx | | cookie | string | — | 微信登录 cookie(文章页登录态),解锁统计与评论 | | download_images | boolean | true | 是否下载文章图片到磁盘 | | save_files | boolean | true | 保存 article.md / article.html / meta.json / images/ | | out_dir | string | <工作区>/wechat_articles | 输出根目录;文件落盘 <out_dir>/<公众号>/<日期>_<标题>/ | | max_retries | integer | 3 | 单 URL 最大重试次数(上限 5) |

工具返回结构化 JSON(oktitleauthoraccountpublish_timedigestcover_urlalbumtagsstatscontent_textcontent_blocksimagesvideoslinkscommentsfileswarnings)以及可读摘要。

独立 CLI(无需 DSH)

内置抓取脚本可脱离 DSH 单独使用:

node lib/fetch_wechat_article.cjs "<url>" [--cookie "<cookie>"] [--no-images] [--out <dir>] [--json] [--max-retries <n>]

要求:Node.js >= 18,零 npm 依赖。

反爬行为

  • 每次尝试轮换 UA(微信移动端 / 桌面端)
  • 指数退避重试 + 抖动(默认 3 次)
  • 验证页检测(环境异常 / 验证码)并明确报错
  • 图片下载:并发 4 + Referer: https://mp.weixin.qq.com/
  • 优先短链接;已删除/过期文章返回 article_unavailable

目录结构

dsh-wechat-article-fetcher/
├── package.json              # dsh.bundle.patch -> cordis.patch.yml
├── cordis.patch.yml          # 插入一个 host 行(id: wechat-article-fetcher)
├── lib/
│   ├── index.js              # cordis 插件:注册 wechat_article_fetcher 工具
│   └── fetch_wechat_article.cjs  # 零依赖反爬抓取 CLI
└── README.md / README.zh.md / README.i18n.yaml

命名

一个产品、三种规范写法:包名(安装名) dsh-wechat-article-fetcher组合行 id wechat-article-fetcher工具名 wechat_article_fetcher

许可证

MIT — 见 LICENSE