优化文档采集工具

- 输出文件名添加 YYMMDD_ 日期前缀,便于按时间排序
- 改用 storageState 完整保存登录态(cookies + localStorage),大幅减少重复扫码
- 增加 TOKEN 轮询宽限期,避免 SPA 异步加载时误判未登录
- 更新 README 文档记录
This commit is contained in:
beyondx123
2026-09-13 14:37:13 +08:00
parent 67ea1ddba2
commit ced9c7bdb3
4 changed files with 197 additions and 36 deletions
+4 -1
View File
@@ -113,7 +113,10 @@ if (images.length > 0) {
}
// ── 6. 保存 Markdown ──────────────────────────────────────────────────────────
const outputPath = resolve(outputDir, `${safeTitle}.md`);
// 文件名加 YYMMDD_ 日期前缀,便于按采集时间排序
const _d = new Date(), _p = n => String(n).padStart(2, '0');
const datePrefix = `${_p(_d.getFullYear() % 100)}${_p(_d.getMonth() + 1)}${_p(_d.getDate())}`;
const outputPath = resolve(outputDir, `${datePrefix}_${safeTitle}.md`);
writeFileSync(outputPath, updatedMarkdown, 'utf-8');
console.log('');