[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-93934":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":15,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":16,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":10,"pushedAt":10,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":15,"starSnapshotCount":15,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},93934,"Outlook-Oauth-GetToken","daimon3332\u002FOutlook-Oauth-GetToken","daimon3332","A standalone OAuth2 refresh_token retrieval tool for existing Outlook \u002F Hotmail accounts. 面向已有 Outlook \u002F Hotmail   账号的独立 OAuth2 refresh_token 获取工具","",null,"Python",124,11,1,0,40.24,false,"main",true,[],"2026-09-21 04:01:26","# OutlookGetToken\n\n给**已注册**但还没有 Graph `refresh_token` 的 Outlook \u002F Hotmail 账号，批量走一遍 OAuth2 授权，把 token 写入结果文件。\n\n核心脚本：`get_refresh_token.py`（patchright 浏览器自动化 + 授权码换 token）。\n\n## 相关项目\n\n- **[OutlookRegister](https:\u002F\u002Fgithub.com\u002Fdaimon3332\u002FOutlookRegister) — 账号注册。** 自动注册 Outlook \u002F Hotmail 账号，并获取 Microsoft Graph OAuth2 `refresh_token`。\n- **[OutlookManage](https:\u002F\u002Fgithub.com\u002Fdaimon3332\u002FOutlookManage) — 账号管理。** 用于导入、检测、刷新和管理已注册的 Outlook 账号及其 OAuth2 凭据。\n\n---\n\n## 1. 如何使用\n\n### 1.1 环境\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fdaimon3332\u002FOutlook-Oauth-GetToken.git\ncd Outlook-Oauth-GetToken\npip install patchright requests\npatchright install chromium\n```\n\n代理软件需已启动（默认示例为本机 `127.0.0.1:7890`）。\n\n### 1.2 准备配置与账号\n\n首次使用：\n\n```bash\n# Windows\ncopy config.example.json config.json\ncopy not_oauth2.example.txt not_oauth2.txt\n\n# Linux \u002F macOS\ncp config.example.json config.json\ncp not_oauth2.example.txt not_oauth2.txt\n```\n\n编辑 `not_oauth2.txt`，**每行一个账号**：\n\n```text\n邮箱----密码\n```\n\n示例：\n\n```text\nuser1@outlook.com----YourPass1\nuser2@hotmail.com----YourPass2\n```\n\n- 以 `#` 开头的行视为注释，忽略  \n- 也兼容更长行（如已有 `邮箱----密码----client_id----token`）：**只取前两段** 邮箱与密码  \n\n按需编辑 `config.json`（代理、并发等，见下一节）。\n\n### 1.3 运行\n\n```bash\npython get_refresh_token.py\n```\n\n成功后会**追加**写入 `oauth2.txt`：\n\n```text\n邮箱----密码----client_id----refresh_token\n```\n\n### 1.4 使用注意\n\n- 工具会弹真实浏览器窗口（`headless=False`）  \n- **不会**自动绑定\u002F接码辅助邮箱；密码后的「保护帐户」页会点 **暂时跳过**  \n- 若已绑过辅助邮箱且弹出「验证你的电子邮件」，会点 **使用密码** 继续  \n- 出现 **帐户已锁定** → 该号直接失败  \n- 同一账号多次成功会重复追加到输出文件，请自行去重  \n\n---\n\n## 2. `config.json` 配置\n\n将 `config.example.json` 复制为 `config.json` 后修改：\n\n```json\n{\n    \"input_file\": \"not_oauth2.txt\",\n    \"output_file\": \"oauth2.txt\",\n    \"concurrent\": 2,\n    \"proxy\": {\n        \"mode\": \"single\",\n        \"type\": \"http\",\n        \"host\": \"127.0.0.1\",\n        \"single_port\": 7890,\n        \"port_start\": 24000,\n        \"port_end\": 24005,\n        \"max_per_proxy\": 20\n    }\n}\n```\n\n### 2.1 顶层字段\n\n| 字段 | 类型 | 说明 |\n|------|------|------|\n| `input_file` | string | 输入文件名，默认 `not_oauth2.txt` |\n| `output_file` | string | 输出文件名，默认 `oauth2.txt`，**追加**写入 |\n| `concurrent` | number | 并发浏览器数；实际为 `min(concurrent, 账号数)` |\n| `proxy` | object | 代理配置，见下表 |\n\n### 2.2 `proxy`\n\n| 字段 | 说明 |\n|------|------|\n| `mode` | `single`：只用 `single_port`；`multiple`：使用 `port_start`～`port_end` 端口池 |\n| `type` | 代理协议，如 `http`、`socks5` |\n| `host` | 代理主机，常见 `127.0.0.1` |\n| `single_port` | `mode=single` 时的端口 |\n| `port_start` \u002F `port_end` | `mode=multiple` 时的端口闭区间 |\n| `max_per_proxy` | 单个端口在进程内最多被选中次数；用满后该端口暂不选，全满则重置计数再选 |\n\n---\n\n## 3. 代码流程\n\n入口：`python get_refresh_token.py` → `main()`。\n\n### 3.1 总览\n\n```text\n读 config.json 与账号文件\n  → 按 concurrent 并发处理每个账号\n  → 成功：追加写入 oauth2.txt\n  → 失败：记录原因后继续下一个\n```\n\n### 3.2 单账号流程\n\n```text\n启动 Chromium（带代理）\n  → 打开 Graph OAuth 授权页\n  → 状态循环（约 120s 内）\n       ├─ 一旦出现 localhost...?code=     → 立刻结束登录，换 token\n       ├─ 「帐户已锁定」                   → 失败\n       ├─ 「验证你的电子邮件」              → 点「使用密码」\n       ├─ 密码框                           → 填密码 + 「下一步」\n       ├─ 邮箱框                           → 填登录邮箱\n       ├─ 「让我们来保护你的帐户」           → 「暂时跳过」\n       ├─ 「保持登录状态？」                 → 点「否」\n       └─ 授权同意页                       → 接受\n  → 用 code 换 refresh_token\n  → 关浏览器\n```\n\n### 3.3 密码之后的分支\n\n**保护帐户 \u002F 锁定页都在输入密码之后。**\n\n| 页面 | 行为 |\n|------|------|\n| 验证你的电子邮件 | 点「使用密码」 |\n| 输入密码 | 填写并点「下一步」 |\n| 让我们来保护你的帐户 | 点「暂时跳过」 |\n| 帐户已锁定 | 直接失败 |\n| 保持登录 | 点「否」 |\n| 同意 \u002F 已授权 | 点接受，或直接拿到 code |\n\n---\n\n## 友情链接\n\n- \u003Ca href=\"https:\u002F\u002Flinux.do\">\u003Cimg src=\".\u002Flinuxdo.webp\" width=\"22\" height=\"22\" alt=\"LINUX DO\" align=\"center\">\u003C\u002Fa> [linux.do](https:\u002F\u002Flinux.do)：**学AI，上L站！！！**\n- [Nodeseek.com](https:\u002F\u002Fwww.nodeseek.com)：**Nodeseek是一个为热爱web开发、托管、vps \u002F服务器和其他极客事物的人提供的地方。**\n","这是一个为已有 Outlook\u002FHotmail 账号批量获取 Microsoft Graph OAuth2 refresh_token 的命令行工具。它通过 Patchright 启动真实 Chromium 浏览器，自动化完成登录、授权码（code）获取及 code 换 token 全流程，并将结果以「邮箱----密码----client_id----refresh_token」格式追加写入文本文件；支持代理配置、并发控制与失败重试机制。适用于需批量初始化账号 OAuth 凭据的场景，如邮件自动化、Graph API 批量调用或账号凭证管理前置准备。",2,"2026-07-28 02:30:07","CREATED_QUERY"]