Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 6 additions & 35 deletions .github/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,9 @@
## MPider v1.0.0 · Windows 原生采集工作台
## MPider v1.0.1

本版采用 Windows 原生列表与会话协议采集,公众号监测、列表采集和正文下载分别控制。仅适配微信 **4.1.15.56 x64**,本版为正式开源发行。
- 公众号列表固定提供「导出所有文章」,导出该号全部已入库文章及已保存图片,同时生成 Markdown 和 HTML。
- 缺正文时显示未下载篇数,并提供下载入口。
- 底栏新增导出进度,切页后保留;完成或失败后隐藏,无任务时不显示。

### 本版变化
Windows x64:推荐使用 `MPider_1.0.1_x64-setup.exe`,也提供中文 MSI 和完整便携 ZIP。

- 公众号监测登记名称、会话与游标;每个公众号分别同步最新文章,或按篇数 / 截止日期采集历史。
- 首页、历史和正文任务分标签管理,支持暂停与检查点续采;新会话到齐后继续原任务。
- 正文与图片进入统一下载队列,支持离线阅读,同时导出 Markdown、HTML、双格式索引和已保存图片。
- 新增公众号文章筛选、确认删除、请求预算与日志排查,以及默认隐藏的游标实验室。
- Windows 安装版支持从 GitHub 检查正式版本、预下载并验证签名,确认后安装与重启。
- 重写 README,更新本版演示截图,移除旧采集方案操作文档。

### 下载选择

| 附件 | 说明 |
| --- | --- |
| `MPider_1.0.0_x64-setup.exe` | 推荐的 NSIS 安装版 |
| `MPider_1.0.0_x64_zh-CN.msi` | 中文 MSI 安装版 |
| `MPider-v1.0.0-windows-x64.zip` | 完整便携包,解压后运行 `MPider.exe`,保留 `runtime/` |
| `latest.json` / `*.sig` | 客户端更新清单与更新签名 |
| `SHA256SUMS` / `verification.json` | 文件摘要与便携包离线自检记录 |

客户端包附带 Python 3.12.10、Frida 17.23.3、cryptography 50.0.2 与第三方许可,无需安装开发环境。另需 Windows 10/11 x64、WebView2 和已登录的适配微信。首次登记和更新会话需要解锁且可交互的桌面。

升级前备份系统设置显示的完整数据目录。便携版迁移到安装版后使用应用内更新;预发布版本不进入稳定更新通道。更新签名不等同于 Windows 开发者代码签名,系统可能提示未知发布者。

### 使用与验证范围

开启公众号监测后,在微信手动打开目标主页;随后在公众号行发起首页同步或历史采集,再单独下载正文。程序不替你操作微信窗口,不要求根证书或系统代理。

本版发布流程在 Windows 检查前端类型、Rust 格式与 Clippy,运行 Rust / Python / Node 离线回归,构建便携包并重新解压验证文件摘要、Python 依赖和虚构材料 AES-GCM / DPAPI 往返,再构建 NSIS / MSI 与签名更新清单。`verification.json` 记录包内源码 revision;Release 附件的 `SHA256SUMS` 对应本次产物。

发行准备已在 Windows 通过 0.2.0 → 0.2.1 的真实 GitHub 更新检查、下载安装包、版本绑定验签、安装和自动重启,并核对文章正文、配置及归档内容保持不变。没有开启微信监测或新增采集请求;安装升级验证不代表真实采集或长期稳定性通过。具体版本的产物与实际验收结果以本 Release 附件和说明为准。

Frida 附加曾导致微信退出;会话可能过期,微信可能要求验证或限制账号。默认间隔、并发与预算只是本地节制配置,不保证免封控。当前仅验证微信 4.1.15.56 x64,指纹不匹配时停止。只采集你有权获取和保存的内容。

[开始使用](https://github.com/areyoubugcoder/mpider#开始采集) · [更新记录](https://github.com/areyoubugcoder/mpider/blob/main/CHANGELOG.md) · [问题反馈](https://github.com/areyoubugcoder/mpider/issues/new/choose)
[更新记录](https://github.com/areyoubugcoder/mpider/blob/main/CHANGELOG.md)
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

本页记录面向使用者的功能与已知限制。开发完成、实机验证和正式发布分别说明,发行状态以 [GitHub Releases](https://github.com/areyoubugcoder/mpider/releases) 为准。

## v1.0.1

- 公众号操作列固定显示「导出所有文章」,覆盖该号全部已入库文章,缺正文时提示并提供下载入口。
- 底栏新增文章导出进度,与正文下载使用相同样式;切换页面后保留,无任务时隐藏。

## v1.0.0 · 正式开源发行

- 正式发布 Windows x64 公众号采集与离线阅读工作台,提供完整便携 ZIP、NSIS 与中文 MSI。
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = ["crates/article-md", "crates/core", "src-tauri"]

[workspace.package]
edition = "2021"
version = "1.0.0"
version = "1.0.1"
license = "MIT"
repository = "https://github.com/areyoubugcoder/mpider"

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

[项目官网](https://areyoubugcoder.github.io/mpider/) · [下载客户端](https://github.com/areyoubugcoder/mpider/releases/latest) · [全部版本](https://github.com/areyoubugcoder/mpider/releases) · [使用说明](docs/windows-standalone.md) · [常见问题](docs/faq.md) · [反馈问题](https://github.com/areyoubugcoder/mpider/issues/new/choose) · [演示视频](https://xhslink.cn/o/8c23uHExcT6) · [进群交流](https://qm.qq.com/q/s4JavFxA3e)

> **v1.0.0 · Windows x64 正式开源版**。当前仅验证微信 **4.1.15.56 x64** 的模块与函数指纹;微信升级后需要重新适配。macOS、Linux 不支持本次原生采集。
> **v1.0.1 · Windows x64 正式开源版**。当前仅验证微信 **4.1.15.56 x64** 的模块与函数指纹;微信升级后需要重新适配。macOS、Linux 不支持本次原生采集。

## 什么是账号池?有什么风险?

Expand Down Expand Up @@ -96,17 +96,17 @@ flowchart TD

| 下载文件 | 用途 |
| --- | --- |
| `MPider_1.0.0_x64-setup.exe` | 推荐,NSIS 安装版,支持应用内更新 |
| `MPider_1.0.0_x64_zh-CN.msi` | 中文 MSI 安装版 |
| `MPider-v1.0.0-windows-x64.zip` | 便携版,完整解压后运行 `MPider.exe`,保留旁边的 `runtime/` |
| `MPider_1.0.1_x64-setup.exe` | 推荐,NSIS 安装版,支持应用内更新 |
| `MPider_1.0.1_x64_zh-CN.msi` | 中文 MSI 安装版 |
| `MPider-v1.0.1-windows-x64.zip` | 便携版,完整解压后运行 `MPider.exe`,保留旁边的 `runtime/` |
| `SHA256SUMS` | 核对下载文件的 SHA-256 |

三个客户端包均携带 Python **3.12.10**、Frida **17.23.3**、cryptography **50.0.2** 及所需许可,无需另外安装 Python、Node.js、pnpm 或 Rust。微信和 WebView2 需要自行安装。不要只复制便携包内的 EXE。

安装包附带应用更新签名,用于 MPider 验证更新文件;它不等同于 Windows 开发者代码签名,系统仍可能提示发布者未知。可先核对附件摘要:

```powershell
Get-FileHash .\MPider_1.0.0_x64-setup.exe -Algorithm SHA256
Get-FileHash .\MPider_1.0.1_x64-setup.exe -Algorithm SHA256
```

## 开始采集
Expand Down
103 changes: 98 additions & 5 deletions crates/core/src/workbench/markdown_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ pub struct MarkdownExport {
pub missing_body: usize,
pub partial_images: usize,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)]
pub struct ExportProgress {
pub completed: usize,
pub total: usize,
}
struct Staging(PathBuf);
impl Drop for Staging {
fn drop(&mut self) {
Expand Down Expand Up @@ -154,17 +160,37 @@ pub fn export_source(
root: &Path,
biz: &str,
destination: &Path,
) -> Result<MarkdownExport> {
export_source_with_progress(store, root, biz, destination, &|_| {})
}

pub fn export_source_with_progress(
store: &Store,
root: &Path,
biz: &str,
destination: &Path,
on_progress: &dyn Fn(ExportProgress),
) -> Result<MarkdownExport> {
validate_selection(store, Some(biz), &[])?;
let articles = store.list_articles(Some(biz), -1, 0, false)?;
export_rows(store, root, articles, Some(biz), destination)
export_rows(store, root, articles, Some(biz), destination, on_progress)
}

pub fn export_articles(
store: &Store,
root: &Path,
ids: &[i64],
destination: &Path,
) -> Result<MarkdownExport> {
export_articles_with_progress(store, root, ids, destination, &|_| {})
}

pub fn export_articles_with_progress(
store: &Store,
root: &Path,
ids: &[i64],
destination: &Path,
on_progress: &dyn Fn(ExportProgress),
) -> Result<MarkdownExport> {
validate_selection(store, None, ids)?;
let ids: std::collections::BTreeSet<i64> = ids.iter().copied().collect();
Expand All @@ -178,14 +204,15 @@ pub fn export_articles(
ensure!(article.is_deleted == 0, "文章已删除或不存在");
articles.push(article);
}
export_rows(store, root, articles, None, destination)
export_rows(store, root, articles, None, destination, on_progress)
}
fn export_rows(
store: &Store,
root: &Path,
articles: Vec<ArticleRow>,
biz: Option<&str>,
destination: &Path,
on_progress: &dyn Fn(ExportProgress),
) -> Result<MarkdownExport> {
ensure!(destination.is_absolute(), "请选择绝对路径的导出目录");
let destination = destination.canonicalize().context("导出目录不存在")?;
Expand Down Expand Up @@ -226,6 +253,10 @@ fn export_rows(
missing_body: 0,
partial_images: 0,
};
on_progress(ExportProgress {
completed: 0,
total: result.total,
});
let nickname = match biz {
Some(biz) => source_name(store, biz)?,
None => "所选文章".into(),
Expand Down Expand Up @@ -365,6 +396,10 @@ fn export_rows(
}
));
manifest.push(json!({"article_id":row.id,"biz":row.biz,"nickname":article_nickname,"title":row.title,"author":row.author,"published_at":row.published_at,"source_url":url,"state":state,"missing_images":missing_images,"markdown":format!("articles/{}/article.md",row.id),"html":format!("articles/{}/article.html",row.id)}));
on_progress(ExportProgress {
completed: result.with_body,
total: result.total,
});
}
html_index.push_str("</ul>");
super::archive::atomic_write(
Expand Down Expand Up @@ -452,7 +487,41 @@ mod tests {
)
.unwrap();
}
let first = export_source(&store, &root.join("workbench"), "FAKE", &output).unwrap();
let progress = std::cell::RefCell::new(Vec::new());
let first = export_source_with_progress(
&store,
&root.join("workbench"),
"FAKE",
&output,
&|update| {
// 上报的每一篇均已写出两种格式,尚未完成时不提前发布导出目录。
let stage = std::fs::read_dir(&output)
.unwrap()
.map(|entry| entry.unwrap().path())
.find(|path| path.to_string_lossy().ends_with(".tmp"))
.unwrap();
let written = std::fs::read_dir(stage.join("articles"))
.into_iter()
.flatten()
.filter(|entry| {
let path = entry.as_ref().unwrap().path();
path.join("article.md").is_file() && path.join("article.html").is_file()
})
.count();
assert_eq!(written, update.completed);
progress.borrow_mut().push(update);
},
)
.unwrap();
assert_eq!(
*progress.borrow(),
(0..=76)
.map(|completed| ExportProgress {
completed,
total: 76
})
.collect::<Vec<_>>()
);
assert_eq!(first.total, 76);
assert_eq!(first.with_body, 76);
assert_eq!(first.missing_body, 0);
Expand Down Expand Up @@ -589,7 +658,14 @@ fn selected_export_deduplicates_cross_source_ids_and_rejects_deleted_rows_before
std::fs::create_dir_all(&root).unwrap();
let before = std::fs::read_dir(&root).unwrap().count();
assert!(validate_selection(&store, None, &[a, b]).is_err());
assert!(export_articles(&store, &root.join("workbench"), &[a, b], &root).is_err());
assert!(export_articles_with_progress(
&store,
&root.join("workbench"),
&[a, b],
&root,
&|_| panic!("正文校验失败时不应开始导出或上报进度"),
)
.is_err());
assert_eq!(std::fs::read_dir(&root).unwrap().count(), before);
store
.upsert_article(
Expand All @@ -602,7 +678,24 @@ fn selected_export_deduplicates_cross_source_ids_and_rejects_deleted_rows_before
},
)
.unwrap();
let result = export_articles(&store, &root.join("workbench"), &[a, b, a], &root).unwrap();
let progress = std::cell::RefCell::new(Vec::new());
let result = export_articles_with_progress(
&store,
&root.join("workbench"),
&[a, b, a],
&root,
&|update| progress.borrow_mut().push(update),
)
.unwrap();
assert_eq!(
*progress.borrow(),
(0..=2)
.map(|completed| ExportProgress {
completed,
total: 2
})
.collect::<Vec<_>>()
);
assert_eq!(result.total, 2);
assert_eq!(result.with_body, 2);
assert_eq!(result.missing_body, 0);
Expand Down
4 changes: 4 additions & 0 deletions docs/article-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

公众号整号、单篇及勾选文章使用同一条导出流程:一次导出同时生成 Markdown 和 HTML,不需要分别选择格式,也不会重新请求微信或下载图片。开始前必须已经下载全部所选正文;取消文件夹选择时不写文件。

在「公众号 → 公众号列表」中,点击该号操作列的「导出所有文章」,再点击「选择导出路径」。范围为该公众号本地已入库的全部文章,包含所有分页,不会自动采集尚未入库的历史文章。导出入口始终显示;有缺失正文时显示已下载和未下载篇数,可点击「下载未完成正文」加入下载队列,完成后再导出。尚无文章时提示先同步或采集。

选定目录开始写出后,窗口底部显示「文章导出」进度,与正文下载使用相同的进度条样式,可点击查看已写出篇数与总篇数。切换页面后仍可查看;整号、单篇和勾选导出共用该进度。完成或失败后自动隐藏,无导出任务或取消目录选择时不显示。

选定目录后,新建唯一子目录;根目录包含 `index.md`、可直接用浏览器打开的 `index.html` 和 `manifest.json`。每篇位于 `articles/<文章ID>/`,同时包含 `article.md`、`article.html` 以及已有本地 `images/`。文件名使用数字 ID,避免 Windows 非法标题字符和同名覆盖。写入失败只清理本次暂存目录,全部成功后整体发布,不覆盖用户原有文件。

正文解析沿用由 [wechat-article-parser](https://github.com/huanjuedadehen/wechat-article-parser) 0.0.6 移植的 `article-md`,第三方 MIT 声明保留于 [THIRD-PARTY-NOTICES.md](../THIRD-PARTY-NOTICES.md)。参考项目负责提取文章元数据、Markdown 及图片链接,本项目在其解析结果上实现本地媒体和双格式导出;不新增 Python 解析进程,也不声称已覆盖其最新 main 的所有版式。
Expand Down
10 changes: 5 additions & 5 deletions docs/windows-standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

当前发行目标为 Windows 10/11 x64 原生工作台。首次登记公众号和更新会话需要已登录、解锁且可交互的微信桌面;保存有效会话后的历史翻页、正文和图片任务仍需电脑与应用运行,但不依赖持续点击微信窗口。不提供无人登录的 Windows 服务或自动唤醒。

v1.0.0 包含独立监测、按公众号任务、Markdown/HTML 双格式导出和 GitHub 签名更新。下载时请核对 Release 的源码版本、文件摘要与验证范围;离线 CI 不代替真实采集与安装升级验证。
v1.0.1 包含独立监测、按公众号任务、Markdown/HTML 双格式导出和 GitHub 签名更新。下载时请核对 Release 的源码版本、文件摘要与验证范围;离线 CI 不代替真实采集与安装升级验证。

## 使用发行包

推荐安装 `MPider_1.0.0_x64-setup.exe`,也可选择 MSI;安装版携带与便携包相同的 Python 环境和许可,并支持应用内签名更新。以下步骤介绍便携 ZIP 的使用。
推荐安装 `MPider_1.0.1_x64-setup.exe`,也可选择 MSI;安装版携带与便携包相同的 Python 环境和许可,并支持应用内签名更新。以下步骤介绍便携 ZIP 的使用。

1. 从 [GitHub Releases](https://github.com/areyoubugcoder/mpider/releases) 下载 `MPider-v版本-windows-x64.zip` 和 `SHA256SUMS`,核对来源及摘要:

```powershell
Get-FileHash .\MPider-v1.0.0-windows-x64.zip -Algorithm SHA256
Get-FileHash .\MPider-v1.0.1-windows-x64.zip -Algorithm SHA256
```

2. **完整解压**到可写目录,保留 `MPider.exe` 旁的 `runtime`。不要只复制 EXE。发行包附带 Python 3.12.10、Frida 17.23.3、cryptography 50.0.2 及其依赖,无需安装 Node.js、pnpm、Rust 或系统 Python。
Expand Down Expand Up @@ -42,7 +42,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -File tools\build-windows.ps1 -Rel

`Bypass` 仅作用于当前 PowerShell 进程,不修改机器策略。脚本遵循已有 `CARGO_TARGET_DIR`,运行 `pnpm tauri build --no-bundle`,把前端与已内嵌的 native worker、JS 和 profiles 编译到 EXE,再附带隔离 Python/Frida 环境,产物位于:

- `dist-windows/MPider-v1.0.0-windows-x64.zip`:完整便携包。
- `dist-windows/MPider-v1.0.1-windows-x64.zip`:完整便携包。
- `dist-windows/SHA256SUMS`:ZIP 的 SHA-256。
- `dist-windows/verification.json`:离线验收记录。

Expand All @@ -57,7 +57,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -File tools\build-windows.ps1 -Rel
`release-manifest.json` 列出包内文件摘要、源码 revision 与依赖版本。独立验证命令为:

```powershell
python tools/verify-windows-release.py --directory dist-windows\MPider-v1.0.0-windows-x64
python tools/verify-windows-release.py --directory dist-windows\MPider-v1.0.1-windows-x64
```

该检查只核对文件完整性、x64 PE、实际 Python/依赖版本以及虚构材料 AES-GCM 和当前用户 DPAPI 往返,不启动微信、不读取真实会话、不发送采集请求。**离线检查成功不代表真实采集或长期稳定性通过。**页面交互验收需在交互桌面另行进行,真实数据不得进入公开包。
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { QueueProgressTrigger } from "@/components/QueueProgressTrigger";
import { laboratoryVisible, saveLaboratoryVisible } from "@/lib/ui-settings";
import { toast } from "sonner";
import { DownloadQueueBar } from "@/components/DownloadQueueBar";
import { ExportQueueBar } from "@/components/ExportQueueBar";
import { ProjectLinks } from "@/components/ProjectLinks";
import { UpdateProvider, UpdateIndicator } from "@/components/AppUpdater";
import { AboutDialog } from "@/components/AboutDialog";
Expand Down Expand Up @@ -52,6 +53,7 @@ export function App() {
<footer className="flex h-10 shrink-0 items-center gap-3 border-t px-3 text-xs text-muted-foreground">
<ProjectLinks />
<div className="ml-auto flex min-w-0 items-center gap-2"><UpdateIndicator onOpen={() => setView("settings")} /><DownloadQueueBar snapshot={snapshot.data} onTasks={() => { setTaskKind("archive");setView("jobs"); }} />
<ExportQueueBar />
{!!snapshot.data?.active_queues?.history.task_count && <QueueProgressTrigger queue={snapshot.data.active_queues.history} label="历史采集" hint="点击查看历史采集任务" onClick={()=>{setTaskKind("history");setView("jobs");}} />}</div>
<HomeSyncStatus snapshot={snapshot.data} />
</footer><AboutDialog open={aboutOpen} onOpenChange={setAboutOpen} version={health.data?.app_version || bundledVersion} /><Toaster />
Expand Down
Loading
Loading