wespy-fetcher

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WeSpy Fetcher

WeSpy Fetcher

封装 tianchangNorth/WeSpy 的完整能力。
封装 tianchangNorth/WeSpy 的全部能力。

功能范围(与 WeSpy 对齐)

功能范围(与WeSpy对齐)

  • 单篇文章抓取(微信公众号 / 通用网页 / 掘金)
  • 微信专辑文章列表获取(
    --album-only
  • 微信专辑批量下载(
    --max-articles
  • 多格式输出(Markdown 默认,支持 HTML / JSON / 全部)
  • 交互模式(不传 URL 时)
  • 单篇文章抓取(微信公众号 / 通用网页 / 掘金)
  • 微信专辑文章列表获取(
    --album-only
  • 微信专辑批量下载(
    --max-articles
  • 多格式输出(默认Markdown,支持HTML / JSON / 全部格式)
  • 交互模式(未传入URL时触发)

依赖来源

依赖来源

  • 上游项目:
    https://github.com/tianchangNorth/WeSpy
  • 本地约定克隆目录:
    ~/Documents/QNSZ/project/WeSpy
  • 上游项目:
    https://github.com/tianchangNorth/WeSpy
  • 本地约定克隆目录:
    ~/Documents/QNSZ/project/WeSpy

使用

使用方法

脚本位置:
scripts/wespy_cli.py
bash
undefined
脚本位置:
scripts/wespy_cli.py
bash
undefined

查看帮助

查看帮助

python3 scripts/wespy_cli.py --help
python3 scripts/wespy_cli.py --help

单篇文章(默认输出 markdown)

单篇文章(默认输出Markdown)

python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/s/xxxxx"
python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/s/xxxxx"

输出 markdown + html

输出Markdown + HTML

python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/s/xxxxx" --html
python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/s/xxxxx" --html

输出 markdown + json

输出Markdown + JSON

python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/s/xxxxx" --json
python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/s/xxxxx" --json

输出所有格式

输出所有格式

python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/s/xxxxx" --all
python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/s/xxxxx" --all

专辑只拉列表

仅获取专辑列表

python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/mp/appmsgalbum?..." --album-only --max-articles 20
python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/mp/appmsgalbum?..." --album-only --max-articles 20

专辑批量下载

专辑批量下载

python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/mp/appmsgalbum?..." --max-articles 20 --all
undefined
python3 scripts/wespy_cli.py "https://mp.weixin.qq.com/mp/appmsgalbum?..." --max-articles 20 --all
undefined

参数

参数说明

透传 WeSpy 原生命令参数:
  • url
  • -o, --output
  • -v, --verbose
  • --html
  • --json
  • --all
  • --max-articles
  • --album-only
透传WeSpy原生命令参数:
  • url
  • -o, --output
  • -v, --verbose
  • --html
  • --json
  • --all
  • --max-articles
  • --album-only

实现说明

实现说明

  • 优先使用本地源码路径
    ~/Documents/QNSZ/project/WeSpy
  • 若本地不存在则自动执行
    git clone
    到该目录
  • 通过导入
    wespy.main.main
    直接调用上游 CLI,保持行为一致
  • 优先使用本地源码路径
    ~/Documents/QNSZ/project/WeSpy
  • 若本地不存在该路径,则自动执行
    git clone
    将项目克隆至该目录
  • 通过导入
    wespy.main.main
    直接调用上游CLI,确保行为与原项目一致