Files
maqt-desktop/docs/SCRAPING_PLAN.md
Chen Gu 5bd314deb2 chore: initial commit - maqt-desktop v0.2
- Phase 1-5: UI framework, auth, weapon schemes, color filters, system optimization
- Industrial/tech design style with Chinese localization
- Points to gch3n.online/delta backend API
- Hardware monitor, filter editor, and all module pages
2026-05-09 00:31:09 +08:00

51 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 码枪堂方案数据采集脚本
## 用途
从 maqt.top 原始 API 采集改枪方案数据,解密后导入到我们的数据库
## 运行环境
Windows 机器 (nplx@100.99.186.30)
## 依赖
- Node.js
- npm install axios crypto-js
## 思路
1. 用已有的 token 调用原始 API
2. 由于前端代码已有解密逻辑,我们需要找到正确的 AES 密钥
3. 或更简单:在 Windows 上通过 deobfuscated 代码直接解密
## 解法一:找密钥
在 CfKCgw5l.js 中搜索以下模式:
- `createDecipheriv``createCipheriv`
- 附近会有 key 和 iv 的生成逻辑
- 密钥可能来自环境变量或硬编码
具体位置需要从 CfKCgw5l.js 或 main.deobfuscated.js 中找到。
## 解法二:利用前端的解密能力
使用 Playwright 或 Puppeteer 加载原始 app 的页面:
1. 加载首页
2. 注入 token
3. 导航到改枪方案页
4. 等待页面渲染JS 自动解密)
5. 从 DOM 中提取数据
6. 或拦截 XHR/fetch 请求获取解密后的 payload
## 采集流程
```
1. 登录 → 获取 token
2. 遍历所有分类 (AR/SMG/SR/LMG/SG/Pistol/Launcher)
3. 对每个分类翻页 (page 1..N)
4. 获取方案列表数据 → 解密
5. 对每个方案获取详情 → 解密
6. 整理格式 → 导入 PostgreSQL
```
## 导入目标
后端: http://100.105.17.52:3001 (开发) / https://gch3n.online/delta (生产)
数据库: PostgreSQL (maqt 数据库, schemes 表)