|
@@ -19,7 +19,7 @@
|
|
|
若首次安装 pip 版本过旧,可先 `python -m pip install --upgrade pip`。
|
|
若首次安装 pip 版本过旧,可先 `python -m pip install --upgrade pip`。
|
|
|
4. 目录布局(已建好):
|
|
4. 目录布局(已建好):
|
|
|
- `configs/settings.json`:统一配置 IMAP/SMTP、默认文件路径(records/……)、主题、起始日期、最小 UID 等(仓库里只放模板 `configs/settings.template.json`,自己复制为 `settings.json` 使用);
|
|
- `configs/settings.json`:统一配置 IMAP/SMTP、默认文件路径(records/……)、主题、起始日期、最小 UID 等(仓库里只放模板 `configs/settings.template.json`,自己复制为 `settings.json` 使用);
|
|
|
- - `configs/curator_state.json`:脚本自动维护的书签与已发送邮箱;
|
|
|
|
|
|
|
+ - `configs/curator_status.json`:脚本自动维护的书签与已发送邮箱;
|
|
|
- `templates/`:HTML 邮件模板(默认使用 `templates/email_template.html`);
|
|
- `templates/`:HTML 邮件模板(默认使用 `templates/email_template.html`);
|
|
|
- `records/`:输入/输出数据文件(默认 `curator_requests.xlsx`、`send_log.xlsx`、`steam_key.txt` 都在这里)。
|
|
- `records/`:输入/输出数据文件(默认 `curator_requests.xlsx`、`send_log.xlsx`、`steam_key.txt` 都在这里)。
|
|
|
|
|
|
|
@@ -34,7 +34,7 @@
|
|
|
"keys": "records/steam_key.txt",
|
|
"keys": "records/steam_key.txt",
|
|
|
"log": "records/send_log.xlsx",
|
|
"log": "records/send_log.xlsx",
|
|
|
"template": "templates/email_template.html",
|
|
"template": "templates/email_template.html",
|
|
|
- "state": "configs/curator_state.json"
|
|
|
|
|
|
|
+ "state": "configs/curator_status.json"
|
|
|
},
|
|
},
|
|
|
"smtp": {
|
|
"smtp": {
|
|
|
"host": "smtp.feishu.cn",
|
|
"host": "smtp.feishu.cn",
|
|
@@ -57,7 +57,7 @@
|
|
|
|
|
|
|
|
## `fetch_requests.py`
|
|
## `fetch_requests.py`
|
|
|
### 作用
|
|
### 作用
|
|
|
-登录 IMAP 邮箱、抓取自上次书签之后的邮件,排除回复/转发,提取 Curator 名称、邮箱、社交链接、所需 key 数等信息写入 `records/curator_requests.xlsx`。脚本会把已处理的邮箱/UID 存在 `configs/curator_state.json`,下次只扫描新的邮件。
|
|
|
|
|
|
|
+登录 IMAP 邮箱、抓取自上次书签之后的邮件,排除回复/转发,提取 Curator 名称、邮箱、社交链接、所需 key 数等信息写入 `records/curator_requests.xlsx`。脚本会把已处理的邮箱/UID 存在 `configs/curator_status.json`,下次只扫描新的邮件。
|
|
|
|
|
|
|
|
IMAP/起始日期/输出路径等全部在 `configs/settings.json` 中维护(运行时可改用 `--config path/to/settings.json`)。
|
|
IMAP/起始日期/输出路径等全部在 `configs/settings.json` 中维护(运行时可改用 `--config path/to/settings.json`)。
|
|
|
|
|
|
|
@@ -78,11 +78,11 @@ python fetch_requests.py --config configs/settings.json --reset-state
|
|
|
python fetch_requests.py --config configs/settings.json --mark-read
|
|
python fetch_requests.py --config configs/settings.json --mark-read
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-运行完成后会在 `records/curator_requests.xlsx` 中追加 `curtor_YYYYMMDD##` 的表格,`configs/curator_state.json` 记录最新 `last_uid`。脚本结束时,还会贴心打印三条推荐命令(Dry-run / Test / Real)。
|
|
|
|
|
|
|
+运行完成后会在 `records/curator_requests.xlsx` 中追加 `curtor_YYYYMMDD##` 的表格,`configs/curator_status.json` 记录最新 `last_uid`。脚本结束时,还会贴心打印三条推荐命令(Dry-run / Test / Real)。
|
|
|
|
|
|
|
|
## `send_keys.py`
|
|
## `send_keys.py`
|
|
|
### 作用
|
|
### 作用
|
|
|
-读取 `records/curator_requests.xlsx` 与 `records/steam_key.txt` 中待分发的激活码,按请求数量配给 key,使用 `templates/email_template.html`(若不存在则用脚本内置模板)渲染 HTML 邮件,通过 SMTP 发送,并在 `records/send_log.xlsx` 里记录“每个 key 一行”的详细日志(每次运行会新增 `sendlog_YYYYMMDD##` 的 sheet 并置顶;真实发送开始前会自动清理旧的 DRYRUN/TEST sheet)。脚本还会在 `configs/curator_state.json` 里维护 `sent_emails` 列表,防止向已发过 key 的邮箱重复派发。支持 Dry-run、Test 模式、跳过已处理 UID、发送成功后把原邮件标记 `\Answered`。如果 Excel 中包含 `Original Message-ID`,回复邮件会自动带上 `In-Reply-To/References`,方便邮件客户端按对话展示。
|
|
|
|
|
|
|
+读取 `records/curator_requests.xlsx` 与 `records/steam_key.txt` 中待分发的激活码,按请求数量配给 key,使用 `templates/email_template.html`(若不存在则用脚本内置模板)渲染 HTML 邮件,通过 SMTP 发送,并在 `records/send_log.xlsx` 里记录“每个 key 一行”的详细日志(每次运行会新增 `sendlog_YYYYMMDD##` 的 sheet 并置顶;真实发送开始前会自动清理旧的 DRYRUN/TEST sheet)。脚本还会在 `configs/curator_status.json` 里维护 `sent_emails` 列表,防止向已发过 key 的邮箱重复派发。支持 Dry-run、Test 模式、跳过已处理 UID、发送成功后把原邮件标记 `\Answered`。如果 Excel 中包含 `Original Message-ID`,回复邮件会自动带上 `In-Reply-To/References`,方便邮件客户端按对话展示。
|
|
|
|
|
|
|
|
### 关键参数
|
|
### 关键参数
|
|
|
默认配置全部来自 `configs/settings.json`,命令行参数只在需要覆盖默认值时使用。常见参数:
|
|
默认配置全部来自 `configs/settings.json`,命令行参数只在需要覆盖默认值时使用。常见参数:
|