Wechat Article Fetcher logo

Wechat Article Fetcher

Community
wwwzhouhui
wechat-article-fetcher

获取并解析微信公众号文章。从微信文章链接中提取标题、作者、公众号名称、正文内容、图片和元数据。当用户提供微信文章链接(mp.weixin.qq.com/s/...)并希望阅读、提取、下载或转换文章内容时使用。适用场景包括获取/下载微信文章、提取微信文章文字或元数据、将微信文章转换为Markdown、将微信文章连同图片保存到本地。关键词:微信公众号、文章获取、文章抓取、文章下载。

Overview

Publisherwwwzhouhui
Repositoryskills_collection
Skill namewechat-article-fetcher
Stars
285
Forks
57
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wwwzhouhui on GitHub. Read the source before you install it.

Installation

Install the Wechat Article Fetcher AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wwwzhouhui/skills_collection/tree/main/wechat-article-fetcher
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wwwzhouhui/skills_collection.git /tmp/skills_collection
mkdir -p .claude/skills
cp -r /tmp/skills_collection/wechat-article-fetcher .claude/skills/wechat-article-fetcher
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Wechat Article Fetcher in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Wechat Article Fetcher on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Wechat Article Fetcher is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

微信公众号文章获取器

获取、解析并保存微信公众号文章,支持单篇和批量下载、元数据提取、图片下载和 Markdown 转换。

快速开始

获取单篇文章:

bash
python scripts/fetch_wechat_article.py "https://mp.weixin.qq.com/s/xxxxx"

批量获取多篇文章(空格分隔):

bash
python scripts/fetch_wechat_article.py "url1" "url2" "url3" --output-dir ./output

批量获取多篇文章(逗号分隔):

bash
python scripts/fetch_wechat_article.py "url1,url2,url3" --output-dir ./output

仅输出元数据(不保存文件):

bash
python scripts/fetch_wechat_article.py "https://mp.weixin.qq.com/s/xxxxx" --json

依赖安装

bash
pip install beautifulsoup4 html2text requests

功能说明

1. 获取文章并保存到本地

bash
python scripts/fetch_wechat_article.py "<url>" --output-dir ./output

输出目录结构:

output/<公众号名称>/<日期>_<标题>/
├── index.html    # 格式化的独立HTML文件
├── article.md    # Markdown版本
├── meta.json     # 文章元数据
└── images/       # 下载的图片

2. 仅提取元数据

bash
python scripts/fetch_wechat_article.py "<url>" --json

返回 JSON 包含:title(标题)、author(作者)、account_nickname(公众号名称)、description(摘要)、create_time(发布时间)、content_text(正文文本)、content_markdown(Markdown内容)、cover_image(封面图)、source_url(原文链接)。

3. 批量下载多篇文章

空格分隔多个链接:

bash
python scripts/fetch_wechat_article.py "url1" "url2" "url3" --output-dir ./output

逗号分隔多个链接:

bash
python scripts/fetch_wechat_article.py "url1,url2,url3" --output-dir ./output

自定义下载间隔(默认3秒,避免触发反爬):

bash
python scripts/fetch_wechat_article.py "url1" "url2" --interval 5

同一公众号的文章自动归类到同一目录下。

4. 不下载图片

bash
python scripts/fetch_wechat_article.py "<url>" --no-images

4. 不下载图片

bash
python scripts/fetch_wechat_article.py "<url>" --no-images

5. 作为 Python 库调用

python
from scripts.fetch_wechat_article import fetch_article, batch_fetch

# 单篇获取并保存
result = fetch_article("https://mp.weixin.qq.com/s/xxxxx", output_dir="./output")
print(result['title'], result['path'])

# 单篇仅获取元数据
meta = fetch_article("https://mp.weixin.qq.com/s/xxxxx", json_only=True)
print(meta['title'])
print(meta['content_text'][:200])

# 批量获取
urls = ["https://mp.weixin.qq.com/s/aaa", "https://mp.weixin.qq.com/s/bbb"]
stats = batch_fetch(urls, output_dir="./output", interval=3.0)
print(f"成功{stats['success']}篇, 失败{stats['fail']}篇")

主要函数参数:

  • url:文章链接(支持短链接和长链接)
  • output_dir:保存目录(默认:./wechat_articles)
  • download_img:是否下载图片(默认:True)
  • to_markdown:是否转换为 Markdown(默认:True)
  • json_only:仅返回元数据字典,不保存文件

batch_fetch 额外参数:

  • urls:文章链接列表
  • interval:每篇文章之间的下载间隔秒数(默认:3.0)

注意事项

  • 优先使用短链接(/s/xxxxx)—— 带 __biz 参数的长链接可能触发验证码。
  • 批量下载时默认间隔3秒,可通过 --interval 调整,避免触发微信反爬机制。
  • 自动使用微信移动端 User-Agent 绕过访问限制。
  • 微信图片使用 data-src 属性(非 src),因为采用了懒加载。
  • 下载图片需要设置 Referer: https://mp.weixin.qq.com/ 请求头。
  • HTML 结构详情参见 references/wechat_html_structure.md。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Wechat Article Fetcher AI skill do?

获取并解析微信公众号文章。从微信文章链接中提取标题、作者、公众号名称、正文内容、图片和元数据。当用户提供微信文章链接(mp.weixin.qq.com/s/...)并希望阅读、提取、下载或转换文章内容时使用。适用场景包括获取/下载微信文章、提取微信文章文字或元数据、将微信文章转换为Markdown、将微信文章连同图片保存到本地。关键词:微信公众号、文章获取、文章抓取、文章下载。

Why use Wechat Article Fetcher on TypingMind?

Because you install it once and use it with any model. Wechat Article Fetcher is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Wechat Article Fetcher in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wwwzhouhui/skills_collection/tree/main/wechat-article-fetcher. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Wechat Article Fetcher?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Wechat Article Fetcher?

As many as you like. As long as a model supports skills, you can use Wechat Article Fetcher with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Wechat Article Fetcher AI skill free?

It is published on GitHub by wwwzhouhui. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇