tempemail-sdk 1.2.2.dev0__tar.gz → 1.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/PKG-INFO +16 -9
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/README.md +15 -8
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/pyproject.toml +1 -1
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempemail_sdk.egg-info/PKG-INFO +16 -9
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempemail_sdk.egg-info/SOURCES.txt +11 -7
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/client.py +92 -44
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/http.py +28 -4
- tempemail_sdk-1.2.3/tempmail_sdk/providers/email10min.py +187 -0
- tempemail_sdk-1.2.3/tempmail_sdk/providers/etempmail.py +116 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/guerrillamail.py +29 -11
- tempemail_sdk-1.2.3/tempmail_sdk/providers/guerrillamail_mirrors.py +96 -0
- tempemail_sdk-1.2.3/tempmail_sdk/providers/harakirimail.py +97 -0
- tempemail_sdk-1.2.3/tempmail_sdk/providers/linshi_co.py +15 -0
- tempemail_sdk-1.2.3/tempmail_sdk/providers/mail_xiuvi.py +15 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/minmail.py +45 -13
- tempemail_sdk-1.2.3/tempmail_sdk/providers/mjj_cm.py +15 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/moakt.py +31 -6
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/smail_pw.py +124 -1
- tempemail_sdk-1.2.3/tempmail_sdk/providers/socketio_mail.py +225 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/tempmail_cn.py +31 -9
- tempemail_sdk-1.2.3/tempmail_sdk/providers/tempmail_lol_v2.py +61 -0
- tempemail_sdk-1.2.3/tempmail_sdk/providers/tempmail_plus.py +101 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/tenminute_one.py +1 -2
- tempemail_sdk-1.2.3/tempmail_sdk/providers/twentyfourmail_chacuo.py +90 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/vip_215.py +76 -12
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/telemetry.py +11 -7
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/types.py +13 -6
- tempemail_sdk-1.2.2.dev0/tempmail_sdk/providers/linshi_email.py +0 -85
- tempemail_sdk-1.2.2.dev0/tempmail_sdk/providers/linshi_token.py +0 -87
- tempemail_sdk-1.2.2.dev0/tempmail_sdk/providers/mail_cx.py +0 -151
- tempemail_sdk-1.2.2.dev0/tempmail_sdk/providers/temp_mail_io.py +0 -87
- tempemail_sdk-1.2.2.dev0/tempmail_sdk/providers/tempmailg.py +0 -197
- tempemail_sdk-1.2.2.dev0/tempmail_sdk/providers/temporary_email_org.py +0 -70
- tempemail_sdk-1.2.2.dev0/tempmail_sdk/providers/tenmail_wangtz.py +0 -118
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/setup.cfg +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempemail_sdk.egg-info/dependency_links.txt +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempemail_sdk.egg-info/requires.txt +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempemail_sdk.egg-info/top_level.txt +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/__init__.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/config.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/logger.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/normalize.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/__init__.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/anonbox.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/awamail.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/boomlify.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/chatgpt_org_uk.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/dropmail.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/emailnator.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/fake_legal.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/linshiyou.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/mail_gw.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/mail_tm.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/maildrop.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/mffac.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/ta_easy.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/tempmail.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/tempmail_lol.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/providers/tmpmails.py +0 -0
- {tempemail_sdk-1.2.2.dev0 → tempemail_sdk-1.2.3}/tempmail_sdk/retry.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tempemail-sdk
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: 临时邮箱 SDK,所有渠道返回统一标准化格式
|
|
5
5
|
License: GPL-3.0
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -15,7 +15,7 @@ Requires-Dist: pygments>=2.19.2; extra == "dev"
|
|
|
15
15
|
|
|
16
16
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
17
17
|
|
|
18
|
-
临时邮箱 SDK(Python),支持 **
|
|
18
|
+
临时邮箱 SDK(Python),支持 **34** 个邮箱服务提供商,顺序与 `client.py` 中 `ALL_CHANNELS` 一致,返回格式与根目录 README 描述一致,并与 Go / npm / Rust / C 对齐。
|
|
19
19
|
|
|
20
20
|
## 安装
|
|
21
21
|
|
|
@@ -34,20 +34,14 @@ pip install https://github.com/XxxXTeam/tempmail-sdk/releases/latest/download/te
|
|
|
34
34
|
| `tempmail` | tempmail.ing | - | 支持自定义有效期 |
|
|
35
35
|
| `tempmail-cn` | tempmail.cn | - | Socket.IO:`request shortid` / `set shortid` / `mail`;`GenerateEmailOptions.domain` 可指定自定义接入域名 |
|
|
36
36
|
| `tmpmails` | tmpmails.com | ✅ | Next.js Server Action 收信;`domain` 可选语言路径 |
|
|
37
|
-
| `tempmailg` | tempmailg.com | ✅ | 独立 `requests.Session` 建邮;`GET /public/{locale}` + `POST /public/get_messages`;Token `tmg1:` + Base64(JSON);`domain` 可选语言路径 |
|
|
38
37
|
| `ta-easy` | ta-easy.com | ✅ | REST `api-endpoint.ta-easy.com` |
|
|
39
|
-
| `10mail-wangtz` | 10mail.wangtz.cn | - | REST `/api/tempMail`、`/api/emailList`;**默认跳过 TLS 证书校验** |
|
|
40
38
|
| `10minute-one` | 10minutemail.one | ✅ | SSR / JWT + Web API;`GenerateEmailOptions.domain` 可选 |
|
|
41
|
-
| `linshi-email` | linshi-email.com | - | |
|
|
42
39
|
| `linshiyou` | linshiyou.com | ✅ | `NEXUS_TOKEN` + Cookie;HTML 分段解析 |
|
|
43
40
|
| `mffac` | mffac.com | ✅ | mailbox `id`;REST 24h |
|
|
44
41
|
| `tempmail-lol` | tempmail.lol | ✅ | 支持指定域名 |
|
|
45
42
|
| `chatgpt-org-uk` | mail.chatgpt.org.uk | ✅ | Inbox Token 等由 SDK 封装 |
|
|
46
|
-
| `temp-mail-io` | temp-mail.io | - | |
|
|
47
43
|
| `awamail` | awamail.com | ✅ | Session Cookie 自动管理 |
|
|
48
|
-
| `temporary-email-org` | temporary-email.org | ✅ | `GET /zh/messages` Cookie + XHR 收信 |
|
|
49
44
|
| `mail-tm` | mail.tm | ✅ | 自动注册账号获取 Bearer Token |
|
|
50
|
-
| `mail-cx` | mail.cx | ✅ | `api.mail.cx` OpenAPI;`GenerateEmailOptions.domain` 可选 |
|
|
51
45
|
| `dropmail` | dropmail.me | ✅ | GraphQL API |
|
|
52
46
|
| `guerrillamail` | guerrillamail.com | ✅ | 公开 JSON API |
|
|
53
47
|
| `maildrop` | maildrop.cx | ✅ | REST:`suffixes.php` + `emails.php`;`description`→`text` |
|
|
@@ -58,6 +52,19 @@ pip install https://github.com/XxxXTeam/tempmail-sdk/releases/latest/download/te
|
|
|
58
52
|
| `anonbox` | anonbox.net | ✅ | `GET /en/` 解析 HTML + mbox 收信 |
|
|
59
53
|
| `fake-legal` | fake.legal | - | `/api/domains` + `/api/inbox/new`;可选 `GenerateEmailOptions.domain` |
|
|
60
54
|
| `moakt` | moakt.com | ✅ | HTML 收件箱 + `tm_session`;`domain` 可选语言路径;独立 `requests` 请求避免污染全局 Session Cookie |
|
|
55
|
+
| `etempmail` | etempmail.com | ✅ | 会话 Cookie + JSON API |
|
|
56
|
+
| `24mail-chacuo` | 24mail.chacuo.net | - | HTTP only;`POST /` 刷新收件箱,适合简单轮询 |
|
|
57
|
+
| `email10min` | email10min.com | ✅ | Cookie + CSRF;`POST /messages` 获取邮箱与邮件 |
|
|
58
|
+
| `mjj-cm` | mjj.cm | ✅ | Socket.IO:`request shortid` / `set shortid` / `mail` |
|
|
59
|
+
| `mail-xiuvi` | mail.xiuvi.cn | ✅ | Socket.IO 克隆站,协议同 `mjj-cm` |
|
|
60
|
+
| `linshi-co` | linshi.co | ✅ | Socket.IO 克隆站,协议同 `mjj-cm` |
|
|
61
|
+
| `harakirimail` | harakirimail.com | - | 公开 REST:`GET /api/v1/inbox/{name}` + `GET /api/v1/email/{id}` |
|
|
62
|
+
| `tempmail-plus` | tempmail.plus | - | 公开 REST:`GET /api/mails/?email=` 列表,`GET /api/mails/{id}?email=` 详情 |
|
|
63
|
+
| `mail-gw` | mail.gw | ✅ | 自动注册账号获取 Bearer Token |
|
|
64
|
+
| `tempmail-lol-v2` | tempmail.lol | ✅ | `GET /generate` 返回 address+token,`GET /auth/{token}` 拉取收件箱 |
|
|
65
|
+
| `sharklasers` | sharklasers.com | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
66
|
+
| `grr-la` | grr.la | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
67
|
+
| `guerrillamail-info` | guerrillamail.info | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
61
68
|
|
|
62
69
|
## 快速开始
|
|
63
70
|
|
|
@@ -147,7 +154,7 @@ export TEMPMAIL_TELEMETRY_URL="https://example.com/v1/event"
|
|
|
147
154
|
from tempmail_sdk import generate_email, GenerateEmailOptions, RetryConfig
|
|
148
155
|
|
|
149
156
|
info = generate_email(GenerateEmailOptions(
|
|
150
|
-
channel="
|
|
157
|
+
channel="mail-gw",
|
|
151
158
|
retry=RetryConfig(max_retries=3, initial_delay=2.0),
|
|
152
159
|
))
|
|
153
160
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
4
4
|
|
|
5
|
-
临时邮箱 SDK(Python),支持 **
|
|
5
|
+
临时邮箱 SDK(Python),支持 **34** 个邮箱服务提供商,顺序与 `client.py` 中 `ALL_CHANNELS` 一致,返回格式与根目录 README 描述一致,并与 Go / npm / Rust / C 对齐。
|
|
6
6
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
@@ -21,20 +21,14 @@ pip install https://github.com/XxxXTeam/tempmail-sdk/releases/latest/download/te
|
|
|
21
21
|
| `tempmail` | tempmail.ing | - | 支持自定义有效期 |
|
|
22
22
|
| `tempmail-cn` | tempmail.cn | - | Socket.IO:`request shortid` / `set shortid` / `mail`;`GenerateEmailOptions.domain` 可指定自定义接入域名 |
|
|
23
23
|
| `tmpmails` | tmpmails.com | ✅ | Next.js Server Action 收信;`domain` 可选语言路径 |
|
|
24
|
-
| `tempmailg` | tempmailg.com | ✅ | 独立 `requests.Session` 建邮;`GET /public/{locale}` + `POST /public/get_messages`;Token `tmg1:` + Base64(JSON);`domain` 可选语言路径 |
|
|
25
24
|
| `ta-easy` | ta-easy.com | ✅ | REST `api-endpoint.ta-easy.com` |
|
|
26
|
-
| `10mail-wangtz` | 10mail.wangtz.cn | - | REST `/api/tempMail`、`/api/emailList`;**默认跳过 TLS 证书校验** |
|
|
27
25
|
| `10minute-one` | 10minutemail.one | ✅ | SSR / JWT + Web API;`GenerateEmailOptions.domain` 可选 |
|
|
28
|
-
| `linshi-email` | linshi-email.com | - | |
|
|
29
26
|
| `linshiyou` | linshiyou.com | ✅ | `NEXUS_TOKEN` + Cookie;HTML 分段解析 |
|
|
30
27
|
| `mffac` | mffac.com | ✅ | mailbox `id`;REST 24h |
|
|
31
28
|
| `tempmail-lol` | tempmail.lol | ✅ | 支持指定域名 |
|
|
32
29
|
| `chatgpt-org-uk` | mail.chatgpt.org.uk | ✅ | Inbox Token 等由 SDK 封装 |
|
|
33
|
-
| `temp-mail-io` | temp-mail.io | - | |
|
|
34
30
|
| `awamail` | awamail.com | ✅ | Session Cookie 自动管理 |
|
|
35
|
-
| `temporary-email-org` | temporary-email.org | ✅ | `GET /zh/messages` Cookie + XHR 收信 |
|
|
36
31
|
| `mail-tm` | mail.tm | ✅ | 自动注册账号获取 Bearer Token |
|
|
37
|
-
| `mail-cx` | mail.cx | ✅ | `api.mail.cx` OpenAPI;`GenerateEmailOptions.domain` 可选 |
|
|
38
32
|
| `dropmail` | dropmail.me | ✅ | GraphQL API |
|
|
39
33
|
| `guerrillamail` | guerrillamail.com | ✅ | 公开 JSON API |
|
|
40
34
|
| `maildrop` | maildrop.cx | ✅ | REST:`suffixes.php` + `emails.php`;`description`→`text` |
|
|
@@ -45,6 +39,19 @@ pip install https://github.com/XxxXTeam/tempmail-sdk/releases/latest/download/te
|
|
|
45
39
|
| `anonbox` | anonbox.net | ✅ | `GET /en/` 解析 HTML + mbox 收信 |
|
|
46
40
|
| `fake-legal` | fake.legal | - | `/api/domains` + `/api/inbox/new`;可选 `GenerateEmailOptions.domain` |
|
|
47
41
|
| `moakt` | moakt.com | ✅ | HTML 收件箱 + `tm_session`;`domain` 可选语言路径;独立 `requests` 请求避免污染全局 Session Cookie |
|
|
42
|
+
| `etempmail` | etempmail.com | ✅ | 会话 Cookie + JSON API |
|
|
43
|
+
| `24mail-chacuo` | 24mail.chacuo.net | - | HTTP only;`POST /` 刷新收件箱,适合简单轮询 |
|
|
44
|
+
| `email10min` | email10min.com | ✅ | Cookie + CSRF;`POST /messages` 获取邮箱与邮件 |
|
|
45
|
+
| `mjj-cm` | mjj.cm | ✅ | Socket.IO:`request shortid` / `set shortid` / `mail` |
|
|
46
|
+
| `mail-xiuvi` | mail.xiuvi.cn | ✅ | Socket.IO 克隆站,协议同 `mjj-cm` |
|
|
47
|
+
| `linshi-co` | linshi.co | ✅ | Socket.IO 克隆站,协议同 `mjj-cm` |
|
|
48
|
+
| `harakirimail` | harakirimail.com | - | 公开 REST:`GET /api/v1/inbox/{name}` + `GET /api/v1/email/{id}` |
|
|
49
|
+
| `tempmail-plus` | tempmail.plus | - | 公开 REST:`GET /api/mails/?email=` 列表,`GET /api/mails/{id}?email=` 详情 |
|
|
50
|
+
| `mail-gw` | mail.gw | ✅ | 自动注册账号获取 Bearer Token |
|
|
51
|
+
| `tempmail-lol-v2` | tempmail.lol | ✅ | `GET /generate` 返回 address+token,`GET /auth/{token}` 拉取收件箱 |
|
|
52
|
+
| `sharklasers` | sharklasers.com | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
53
|
+
| `grr-la` | grr.la | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
54
|
+
| `guerrillamail-info` | guerrillamail.info | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
48
55
|
|
|
49
56
|
## 快速开始
|
|
50
57
|
|
|
@@ -134,7 +141,7 @@ export TEMPMAIL_TELEMETRY_URL="https://example.com/v1/event"
|
|
|
134
141
|
from tempmail_sdk import generate_email, GenerateEmailOptions, RetryConfig
|
|
135
142
|
|
|
136
143
|
info = generate_email(GenerateEmailOptions(
|
|
137
|
-
channel="
|
|
144
|
+
channel="mail-gw",
|
|
138
145
|
retry=RetryConfig(max_retries=3, initial_delay=2.0),
|
|
139
146
|
))
|
|
140
147
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tempemail-sdk
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: 临时邮箱 SDK,所有渠道返回统一标准化格式
|
|
5
5
|
License: GPL-3.0
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -15,7 +15,7 @@ Requires-Dist: pygments>=2.19.2; extra == "dev"
|
|
|
15
15
|
|
|
16
16
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
17
17
|
|
|
18
|
-
临时邮箱 SDK(Python),支持 **
|
|
18
|
+
临时邮箱 SDK(Python),支持 **34** 个邮箱服务提供商,顺序与 `client.py` 中 `ALL_CHANNELS` 一致,返回格式与根目录 README 描述一致,并与 Go / npm / Rust / C 对齐。
|
|
19
19
|
|
|
20
20
|
## 安装
|
|
21
21
|
|
|
@@ -34,20 +34,14 @@ pip install https://github.com/XxxXTeam/tempmail-sdk/releases/latest/download/te
|
|
|
34
34
|
| `tempmail` | tempmail.ing | - | 支持自定义有效期 |
|
|
35
35
|
| `tempmail-cn` | tempmail.cn | - | Socket.IO:`request shortid` / `set shortid` / `mail`;`GenerateEmailOptions.domain` 可指定自定义接入域名 |
|
|
36
36
|
| `tmpmails` | tmpmails.com | ✅ | Next.js Server Action 收信;`domain` 可选语言路径 |
|
|
37
|
-
| `tempmailg` | tempmailg.com | ✅ | 独立 `requests.Session` 建邮;`GET /public/{locale}` + `POST /public/get_messages`;Token `tmg1:` + Base64(JSON);`domain` 可选语言路径 |
|
|
38
37
|
| `ta-easy` | ta-easy.com | ✅ | REST `api-endpoint.ta-easy.com` |
|
|
39
|
-
| `10mail-wangtz` | 10mail.wangtz.cn | - | REST `/api/tempMail`、`/api/emailList`;**默认跳过 TLS 证书校验** |
|
|
40
38
|
| `10minute-one` | 10minutemail.one | ✅ | SSR / JWT + Web API;`GenerateEmailOptions.domain` 可选 |
|
|
41
|
-
| `linshi-email` | linshi-email.com | - | |
|
|
42
39
|
| `linshiyou` | linshiyou.com | ✅ | `NEXUS_TOKEN` + Cookie;HTML 分段解析 |
|
|
43
40
|
| `mffac` | mffac.com | ✅ | mailbox `id`;REST 24h |
|
|
44
41
|
| `tempmail-lol` | tempmail.lol | ✅ | 支持指定域名 |
|
|
45
42
|
| `chatgpt-org-uk` | mail.chatgpt.org.uk | ✅ | Inbox Token 等由 SDK 封装 |
|
|
46
|
-
| `temp-mail-io` | temp-mail.io | - | |
|
|
47
43
|
| `awamail` | awamail.com | ✅ | Session Cookie 自动管理 |
|
|
48
|
-
| `temporary-email-org` | temporary-email.org | ✅ | `GET /zh/messages` Cookie + XHR 收信 |
|
|
49
44
|
| `mail-tm` | mail.tm | ✅ | 自动注册账号获取 Bearer Token |
|
|
50
|
-
| `mail-cx` | mail.cx | ✅ | `api.mail.cx` OpenAPI;`GenerateEmailOptions.domain` 可选 |
|
|
51
45
|
| `dropmail` | dropmail.me | ✅ | GraphQL API |
|
|
52
46
|
| `guerrillamail` | guerrillamail.com | ✅ | 公开 JSON API |
|
|
53
47
|
| `maildrop` | maildrop.cx | ✅ | REST:`suffixes.php` + `emails.php`;`description`→`text` |
|
|
@@ -58,6 +52,19 @@ pip install https://github.com/XxxXTeam/tempmail-sdk/releases/latest/download/te
|
|
|
58
52
|
| `anonbox` | anonbox.net | ✅ | `GET /en/` 解析 HTML + mbox 收信 |
|
|
59
53
|
| `fake-legal` | fake.legal | - | `/api/domains` + `/api/inbox/new`;可选 `GenerateEmailOptions.domain` |
|
|
60
54
|
| `moakt` | moakt.com | ✅ | HTML 收件箱 + `tm_session`;`domain` 可选语言路径;独立 `requests` 请求避免污染全局 Session Cookie |
|
|
55
|
+
| `etempmail` | etempmail.com | ✅ | 会话 Cookie + JSON API |
|
|
56
|
+
| `24mail-chacuo` | 24mail.chacuo.net | - | HTTP only;`POST /` 刷新收件箱,适合简单轮询 |
|
|
57
|
+
| `email10min` | email10min.com | ✅ | Cookie + CSRF;`POST /messages` 获取邮箱与邮件 |
|
|
58
|
+
| `mjj-cm` | mjj.cm | ✅ | Socket.IO:`request shortid` / `set shortid` / `mail` |
|
|
59
|
+
| `mail-xiuvi` | mail.xiuvi.cn | ✅ | Socket.IO 克隆站,协议同 `mjj-cm` |
|
|
60
|
+
| `linshi-co` | linshi.co | ✅ | Socket.IO 克隆站,协议同 `mjj-cm` |
|
|
61
|
+
| `harakirimail` | harakirimail.com | - | 公开 REST:`GET /api/v1/inbox/{name}` + `GET /api/v1/email/{id}` |
|
|
62
|
+
| `tempmail-plus` | tempmail.plus | - | 公开 REST:`GET /api/mails/?email=` 列表,`GET /api/mails/{id}?email=` 详情 |
|
|
63
|
+
| `mail-gw` | mail.gw | ✅ | 自动注册账号获取 Bearer Token |
|
|
64
|
+
| `tempmail-lol-v2` | tempmail.lol | ✅ | `GET /generate` 返回 address+token,`GET /auth/{token}` 拉取收件箱 |
|
|
65
|
+
| `sharklasers` | sharklasers.com | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
66
|
+
| `grr-la` | grr.la | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
67
|
+
| `guerrillamail-info` | guerrillamail.info | ✅ | GuerrillaMail 镜像,API 与 `guerrillamail` 相同 |
|
|
61
68
|
|
|
62
69
|
## 快速开始
|
|
63
70
|
|
|
@@ -147,7 +154,7 @@ export TEMPMAIL_TELEMETRY_URL="https://example.com/v1/event"
|
|
|
147
154
|
from tempmail_sdk import generate_email, GenerateEmailOptions, RetryConfig
|
|
148
155
|
|
|
149
156
|
info = generate_email(GenerateEmailOptions(
|
|
150
|
-
channel="
|
|
157
|
+
channel="mail-gw",
|
|
151
158
|
retry=RetryConfig(max_retries=3, initial_delay=2.0),
|
|
152
159
|
))
|
|
153
160
|
```
|
|
@@ -20,28 +20,32 @@ tempmail_sdk/providers/awamail.py
|
|
|
20
20
|
tempmail_sdk/providers/boomlify.py
|
|
21
21
|
tempmail_sdk/providers/chatgpt_org_uk.py
|
|
22
22
|
tempmail_sdk/providers/dropmail.py
|
|
23
|
+
tempmail_sdk/providers/email10min.py
|
|
23
24
|
tempmail_sdk/providers/emailnator.py
|
|
25
|
+
tempmail_sdk/providers/etempmail.py
|
|
24
26
|
tempmail_sdk/providers/fake_legal.py
|
|
25
27
|
tempmail_sdk/providers/guerrillamail.py
|
|
26
|
-
tempmail_sdk/providers/
|
|
27
|
-
tempmail_sdk/providers/
|
|
28
|
+
tempmail_sdk/providers/guerrillamail_mirrors.py
|
|
29
|
+
tempmail_sdk/providers/harakirimail.py
|
|
30
|
+
tempmail_sdk/providers/linshi_co.py
|
|
28
31
|
tempmail_sdk/providers/linshiyou.py
|
|
29
|
-
tempmail_sdk/providers/mail_cx.py
|
|
30
32
|
tempmail_sdk/providers/mail_gw.py
|
|
31
33
|
tempmail_sdk/providers/mail_tm.py
|
|
34
|
+
tempmail_sdk/providers/mail_xiuvi.py
|
|
32
35
|
tempmail_sdk/providers/maildrop.py
|
|
33
36
|
tempmail_sdk/providers/mffac.py
|
|
34
37
|
tempmail_sdk/providers/minmail.py
|
|
38
|
+
tempmail_sdk/providers/mjj_cm.py
|
|
35
39
|
tempmail_sdk/providers/moakt.py
|
|
36
40
|
tempmail_sdk/providers/smail_pw.py
|
|
41
|
+
tempmail_sdk/providers/socketio_mail.py
|
|
37
42
|
tempmail_sdk/providers/ta_easy.py
|
|
38
|
-
tempmail_sdk/providers/temp_mail_io.py
|
|
39
43
|
tempmail_sdk/providers/tempmail.py
|
|
40
44
|
tempmail_sdk/providers/tempmail_cn.py
|
|
41
45
|
tempmail_sdk/providers/tempmail_lol.py
|
|
42
|
-
tempmail_sdk/providers/
|
|
43
|
-
tempmail_sdk/providers/
|
|
44
|
-
tempmail_sdk/providers/tenmail_wangtz.py
|
|
46
|
+
tempmail_sdk/providers/tempmail_lol_v2.py
|
|
47
|
+
tempmail_sdk/providers/tempmail_plus.py
|
|
45
48
|
tempmail_sdk/providers/tenminute_one.py
|
|
46
49
|
tempmail_sdk/providers/tmpmails.py
|
|
50
|
+
tempmail_sdk/providers/twentyfourmail_chacuo.py
|
|
47
51
|
tempmail_sdk/providers/vip_215.py
|
|
@@ -14,18 +14,25 @@ from .retry import with_retry, with_retry_with_attempts
|
|
|
14
14
|
from .telemetry import report_telemetry
|
|
15
15
|
from .logger import get_logger
|
|
16
16
|
from .providers import (
|
|
17
|
-
tempmail, tempmail_cn, tmpmails,
|
|
18
|
-
|
|
17
|
+
tempmail, tempmail_cn, tmpmails, ta_easy, linshiyou, mffac, tempmail_lol, chatgpt_org_uk,
|
|
18
|
+
awamail, mail_tm,
|
|
19
19
|
dropmail, guerrillamail, maildrop, smail_pw,
|
|
20
|
-
boomlify, minmail, vip_215, anonbox, fake_legal, moakt, tenminute_one,
|
|
20
|
+
boomlify, minmail, vip_215, anonbox, fake_legal, moakt, tenminute_one, etempmail,
|
|
21
|
+
twentyfourmail_chacuo, email10min, mjj_cm, mail_xiuvi, linshi_co,
|
|
22
|
+
harakirimail, tempmail_plus,
|
|
23
|
+
mail_gw, tempmail_lol_v2, guerrillamail_mirrors,
|
|
21
24
|
)
|
|
22
25
|
|
|
23
26
|
# 所有支持的渠道列表
|
|
24
27
|
ALL_CHANNELS = [
|
|
25
|
-
"tempmail", "tempmail-cn", "tmpmails", "
|
|
26
|
-
"
|
|
28
|
+
"tempmail", "tempmail-cn", "tmpmails", "ta-easy", "10minute-one", "linshiyou", "mffac", "tempmail-lol", "chatgpt-org-uk",
|
|
29
|
+
"awamail", "mail-tm",
|
|
27
30
|
"dropmail", "guerrillamail", "maildrop", "smail-pw",
|
|
28
|
-
"boomlify", "minmail", "vip-215", "anonbox", "fake-legal", "moakt",
|
|
31
|
+
"boomlify", "minmail", "vip-215", "anonbox", "fake-legal", "moakt", "etempmail",
|
|
32
|
+
"24mail-chacuo", "email10min", "mjj-cm", "mail-xiuvi", "linshi-co",
|
|
33
|
+
"harakirimail",
|
|
34
|
+
"tempmail-plus",
|
|
35
|
+
"mail-gw", "tempmail-lol-v2", "sharklasers", "grr-la", "guerrillamail-info",
|
|
29
36
|
]
|
|
30
37
|
|
|
31
38
|
# 渠道信息映射表
|
|
@@ -33,20 +40,14 @@ CHANNEL_INFO_MAP = {
|
|
|
33
40
|
"tempmail": ChannelInfo(channel="tempmail", name="TempMail", website="tempmail.ing"),
|
|
34
41
|
"tempmail-cn": ChannelInfo(channel="tempmail-cn", name="TempMail CN", website="tempmail.cn"),
|
|
35
42
|
"tmpmails": ChannelInfo(channel="tmpmails", name="TmpMails", website="tmpmails.com"),
|
|
36
|
-
"tempmailg": ChannelInfo(channel="tempmailg", name="TempMailG", website="tempmailg.com"),
|
|
37
43
|
"ta-easy": ChannelInfo(channel="ta-easy", name="TA Easy", website="ta-easy.com"),
|
|
38
|
-
"10mail-wangtz": ChannelInfo(channel="10mail-wangtz", name="10mail Wangtz", website="10mail.wangtz.cn"),
|
|
39
44
|
"10minute-one": ChannelInfo(channel="10minute-one", name="10 Minute Email", website="10minutemail.one"),
|
|
40
|
-
"linshi-email": ChannelInfo(channel="linshi-email", name="临时邮箱", website="linshi-email.com"),
|
|
41
45
|
"linshiyou": ChannelInfo(channel="linshiyou", name="临时邮", website="linshiyou.com"),
|
|
42
46
|
"mffac": ChannelInfo(channel="mffac", name="MFFAC", website="mffac.com"),
|
|
43
47
|
"tempmail-lol": ChannelInfo(channel="tempmail-lol", name="TempMail LOL", website="tempmail.lol"),
|
|
44
48
|
"chatgpt-org-uk": ChannelInfo(channel="chatgpt-org-uk", name="ChatGPT Mail", website="mail.chatgpt.org.uk"),
|
|
45
|
-
"temp-mail-io": ChannelInfo(channel="temp-mail-io", name="Temp Mail IO", website="temp-mail.io"),
|
|
46
49
|
"awamail": ChannelInfo(channel="awamail", name="AwaMail", website="awamail.com"),
|
|
47
|
-
"temporary-email-org": ChannelInfo(channel="temporary-email-org", name="Temporary Email", website="temporary-email.org"),
|
|
48
50
|
"mail-tm": ChannelInfo(channel="mail-tm", name="Mail.tm", website="mail.tm"),
|
|
49
|
-
"mail-cx": ChannelInfo(channel="mail-cx", name="Mail.cx", website="mail.cx"),
|
|
50
51
|
"dropmail": ChannelInfo(channel="dropmail", name="DropMail", website="dropmail.me"),
|
|
51
52
|
"guerrillamail": ChannelInfo(channel="guerrillamail", name="Guerrilla Mail", website="guerrillamail.com"),
|
|
52
53
|
"maildrop": ChannelInfo(channel="maildrop", name="Maildrop", website="maildrop.cx"),
|
|
@@ -57,6 +58,19 @@ CHANNEL_INFO_MAP = {
|
|
|
57
58
|
"anonbox": ChannelInfo(channel="anonbox", name="Anonbox", website="anonbox.net"),
|
|
58
59
|
"fake-legal": ChannelInfo(channel="fake-legal", name="Fake Legal", website="fake.legal"),
|
|
59
60
|
"moakt": ChannelInfo(channel="moakt", name="Moakt", website="moakt.com"),
|
|
61
|
+
"etempmail": ChannelInfo(channel="etempmail", name="eTempMail", website="etempmail.com"),
|
|
62
|
+
"24mail-chacuo": ChannelInfo(channel="24mail-chacuo", name="24Mail Chacuo", website="24mail.chacuo.net"),
|
|
63
|
+
"email10min": ChannelInfo(channel="email10min", name="Email10Min", website="email10min.com"),
|
|
64
|
+
"mjj-cm": ChannelInfo(channel="mjj-cm", name="MJJ Mail", website="mjj.cm"),
|
|
65
|
+
"mail-xiuvi": ChannelInfo(channel="mail-xiuvi", name="Xiuvi Mail", website="mail.xiuvi.cn"),
|
|
66
|
+
"linshi-co": ChannelInfo(channel="linshi-co", name="临时Co", website="linshi.co"),
|
|
67
|
+
"harakirimail": ChannelInfo(channel="harakirimail", name="HarakiriMail", website="harakirimail.com"),
|
|
68
|
+
"tempmail-plus": ChannelInfo(channel="tempmail-plus", name="TempMail Plus", website="tempmail.plus"),
|
|
69
|
+
"mail-gw": ChannelInfo(channel="mail-gw", name="Mail.gw", website="mail.gw"),
|
|
70
|
+
"tempmail-lol-v2": ChannelInfo(channel="tempmail-lol-v2", name="TempMail LOL V2", website="tempmail.lol"),
|
|
71
|
+
"sharklasers": ChannelInfo(channel="sharklasers", name="SharkLasers", website="sharklasers.com"),
|
|
72
|
+
"grr-la": ChannelInfo(channel="grr-la", name="Grr.la", website="grr.la"),
|
|
73
|
+
"guerrillamail-info": ChannelInfo(channel="guerrillamail-info", name="GuerrillaMail Info", website="guerrillamail.info"),
|
|
60
74
|
}
|
|
61
75
|
|
|
62
76
|
|
|
@@ -138,16 +152,10 @@ def _generate_email_once(channel: str, options: GenerateEmailOptions) -> EmailIn
|
|
|
138
152
|
return tempmail_cn.generate_email(options.domain)
|
|
139
153
|
elif channel == "tmpmails":
|
|
140
154
|
return tmpmails.generate_email(options.domain)
|
|
141
|
-
elif channel == "tempmailg":
|
|
142
|
-
return tempmailg.generate_email(options.domain)
|
|
143
155
|
elif channel == "ta-easy":
|
|
144
156
|
return ta_easy.generate_email()
|
|
145
|
-
elif channel == "10mail-wangtz":
|
|
146
|
-
return tenmail_wangtz.generate_email(options.domain)
|
|
147
157
|
elif channel == "10minute-one":
|
|
148
158
|
return tenminute_one.generate_email(options.domain)
|
|
149
|
-
elif channel == "linshi-email":
|
|
150
|
-
return linshi_email.generate_email()
|
|
151
159
|
elif channel == "linshiyou":
|
|
152
160
|
return linshiyou.generate_email()
|
|
153
161
|
elif channel == "mffac":
|
|
@@ -156,16 +164,10 @@ def _generate_email_once(channel: str, options: GenerateEmailOptions) -> EmailIn
|
|
|
156
164
|
return tempmail_lol.generate_email(options.domain)
|
|
157
165
|
elif channel == "chatgpt-org-uk":
|
|
158
166
|
return chatgpt_org_uk.generate_email()
|
|
159
|
-
elif channel == "temp-mail-io":
|
|
160
|
-
return temp_mail_io.generate_email()
|
|
161
167
|
elif channel == "awamail":
|
|
162
168
|
return awamail.generate_email()
|
|
163
|
-
elif channel == "temporary-email-org":
|
|
164
|
-
return temporary_email_org.generate_email()
|
|
165
169
|
elif channel == "mail-tm":
|
|
166
170
|
return mail_tm.generate_email()
|
|
167
|
-
elif channel == "mail-cx":
|
|
168
|
-
return mail_cx.generate_email(options.domain)
|
|
169
171
|
elif channel == "dropmail":
|
|
170
172
|
return dropmail.generate_email()
|
|
171
173
|
elif channel == "guerrillamail":
|
|
@@ -186,6 +188,32 @@ def _generate_email_once(channel: str, options: GenerateEmailOptions) -> EmailIn
|
|
|
186
188
|
return fake_legal.generate_email(options.domain)
|
|
187
189
|
elif channel == "moakt":
|
|
188
190
|
return moakt.generate_email(options.domain)
|
|
191
|
+
elif channel == "etempmail":
|
|
192
|
+
return etempmail.generate_email()
|
|
193
|
+
elif channel == "24mail-chacuo":
|
|
194
|
+
return twentyfourmail_chacuo.generate_email()
|
|
195
|
+
elif channel == "email10min":
|
|
196
|
+
return email10min.generate_email()
|
|
197
|
+
elif channel == "mjj-cm":
|
|
198
|
+
return mjj_cm.generate_email()
|
|
199
|
+
elif channel == "mail-xiuvi":
|
|
200
|
+
return mail_xiuvi.generate_email()
|
|
201
|
+
elif channel == "linshi-co":
|
|
202
|
+
return linshi_co.generate_email()
|
|
203
|
+
elif channel == "harakirimail":
|
|
204
|
+
return harakirimail.generate_email()
|
|
205
|
+
elif channel == "tempmail-plus":
|
|
206
|
+
return tempmail_plus.generate_email()
|
|
207
|
+
elif channel == "mail-gw":
|
|
208
|
+
return mail_gw.generate_email()
|
|
209
|
+
elif channel == "tempmail-lol-v2":
|
|
210
|
+
return tempmail_lol_v2.generate_email()
|
|
211
|
+
elif channel == "sharklasers":
|
|
212
|
+
return guerrillamail_mirrors.sharklasers_generate()
|
|
213
|
+
elif channel == "grr-la":
|
|
214
|
+
return guerrillamail_mirrors.grrla_generate()
|
|
215
|
+
elif channel == "guerrillamail-info":
|
|
216
|
+
return guerrillamail_mirrors.guerrillamail_info_generate()
|
|
189
217
|
else:
|
|
190
218
|
raise ValueError(f"Unknown channel: {channel}")
|
|
191
219
|
|
|
@@ -256,20 +284,10 @@ def _get_emails_once(channel: str, email: str, token: Optional[str]) -> List[Ema
|
|
|
256
284
|
if not token:
|
|
257
285
|
raise ValueError("token is required for tmpmails channel")
|
|
258
286
|
return tmpmails.get_emails(email, token)
|
|
259
|
-
elif channel == "tempmailg":
|
|
260
|
-
if not token:
|
|
261
|
-
raise ValueError("token is required for tempmailg channel")
|
|
262
|
-
return tempmailg.get_emails(email, token)
|
|
263
287
|
elif channel == "ta-easy":
|
|
264
288
|
if not token:
|
|
265
289
|
raise ValueError("token is required for ta-easy channel")
|
|
266
290
|
return ta_easy.get_emails(email, token)
|
|
267
|
-
elif channel == "10mail-wangtz":
|
|
268
|
-
return tenmail_wangtz.get_emails(email, token or "")
|
|
269
|
-
elif channel == "linshi-email":
|
|
270
|
-
if not token:
|
|
271
|
-
raise ValueError("token is required for linshi-email channel")
|
|
272
|
-
return linshi_email.get_emails(email, token)
|
|
273
291
|
elif channel == "linshiyou":
|
|
274
292
|
if not token:
|
|
275
293
|
raise ValueError("token is required for linshiyou channel")
|
|
@@ -284,24 +302,14 @@ def _get_emails_once(channel: str, email: str, token: Optional[str]) -> List[Ema
|
|
|
284
302
|
if not token:
|
|
285
303
|
raise ValueError("token is required for chatgpt-org-uk channel")
|
|
286
304
|
return chatgpt_org_uk.get_emails(token, email)
|
|
287
|
-
elif channel == "temp-mail-io":
|
|
288
|
-
return temp_mail_io.get_emails(email)
|
|
289
305
|
elif channel == "awamail":
|
|
290
306
|
if not token:
|
|
291
307
|
raise ValueError("token is required for awamail channel")
|
|
292
308
|
return awamail.get_emails(token, email)
|
|
293
|
-
elif channel == "temporary-email-org":
|
|
294
|
-
if not token:
|
|
295
|
-
raise ValueError("token is required for temporary-email-org channel")
|
|
296
|
-
return temporary_email_org.get_emails(token, email)
|
|
297
309
|
elif channel == "mail-tm":
|
|
298
310
|
if not token:
|
|
299
311
|
raise ValueError("token is required for mail-tm channel")
|
|
300
312
|
return mail_tm.get_emails(token, email)
|
|
301
|
-
elif channel == "mail-cx":
|
|
302
|
-
if not token:
|
|
303
|
-
raise ValueError("token is required for mail-cx channel")
|
|
304
|
-
return mail_cx.get_emails(token, email)
|
|
305
313
|
elif channel == "dropmail":
|
|
306
314
|
if not token:
|
|
307
315
|
raise ValueError("token is required for dropmail channel")
|
|
@@ -338,10 +346,50 @@ def _get_emails_once(channel: str, email: str, token: Optional[str]) -> List[Ema
|
|
|
338
346
|
if not token:
|
|
339
347
|
raise ValueError("token is required for moakt channel")
|
|
340
348
|
return moakt.get_emails(email, token)
|
|
349
|
+
elif channel == "etempmail":
|
|
350
|
+
if not token:
|
|
351
|
+
raise ValueError("token is required for etempmail channel")
|
|
352
|
+
return etempmail.get_emails(email, token)
|
|
341
353
|
elif channel == "10minute-one":
|
|
342
354
|
if not token:
|
|
343
355
|
raise ValueError("token is required for 10minute-one channel")
|
|
344
356
|
return tenminute_one.get_emails(email, token)
|
|
357
|
+
elif channel == "24mail-chacuo":
|
|
358
|
+
return twentyfourmail_chacuo.get_emails(email)
|
|
359
|
+
elif channel == "email10min":
|
|
360
|
+
if not token:
|
|
361
|
+
raise ValueError("token is required for email10min channel")
|
|
362
|
+
return email10min.get_emails(email, token)
|
|
363
|
+
elif channel == "mjj-cm":
|
|
364
|
+
return mjj_cm.get_emails(email)
|
|
365
|
+
elif channel == "mail-xiuvi":
|
|
366
|
+
return mail_xiuvi.get_emails(email)
|
|
367
|
+
elif channel == "linshi-co":
|
|
368
|
+
return linshi_co.get_emails(email)
|
|
369
|
+
elif channel == "harakirimail":
|
|
370
|
+
return harakirimail.get_emails(email)
|
|
371
|
+
elif channel == "tempmail-plus":
|
|
372
|
+
return tempmail_plus.get_emails(email)
|
|
373
|
+
elif channel == "mail-gw":
|
|
374
|
+
if not token:
|
|
375
|
+
raise ValueError("token is required for mail-gw channel")
|
|
376
|
+
return mail_gw.get_emails(token, email)
|
|
377
|
+
elif channel == "tempmail-lol-v2":
|
|
378
|
+
if not token:
|
|
379
|
+
raise ValueError("token is required for tempmail-lol-v2 channel")
|
|
380
|
+
return tempmail_lol_v2.get_emails(token, email)
|
|
381
|
+
elif channel == "sharklasers":
|
|
382
|
+
if not token:
|
|
383
|
+
raise ValueError("token is required for sharklasers channel")
|
|
384
|
+
return guerrillamail_mirrors.sharklasers_get_emails(token, email)
|
|
385
|
+
elif channel == "grr-la":
|
|
386
|
+
if not token:
|
|
387
|
+
raise ValueError("token is required for grr-la channel")
|
|
388
|
+
return guerrillamail_mirrors.grrla_get_emails(token, email)
|
|
389
|
+
elif channel == "guerrillamail-info":
|
|
390
|
+
if not token:
|
|
391
|
+
raise ValueError("token is required for guerrillamail-info channel")
|
|
392
|
+
return guerrillamail_mirrors.guerrillamail_info_get_emails(token, email)
|
|
345
393
|
else:
|
|
346
394
|
raise ValueError(f"Unknown channel: {channel}")
|
|
347
395
|
|
|
@@ -9,10 +9,26 @@
|
|
|
9
9
|
- 缓存 timeout 避免每次请求都读取 config
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
+
import random
|
|
12
13
|
import requests
|
|
13
14
|
from requests.adapters import HTTPAdapter
|
|
14
15
|
from .config import get_config, get_config_version
|
|
15
16
|
|
|
17
|
+
|
|
18
|
+
def _random_ipv4() -> str:
|
|
19
|
+
"""生成随机 IPv4 地址(每段 1-254),用于伪造来源 IP 请求头"""
|
|
20
|
+
return ".".join(str(random.randint(1, 254)) for _ in range(4))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _spoof_ip_headers() -> dict:
|
|
24
|
+
"""生成一组伪造来源 IP 的请求头,所有头使用同一个随机 IP"""
|
|
25
|
+
ip = _random_ipv4()
|
|
26
|
+
return {
|
|
27
|
+
"X-Forwarded-For": ip,
|
|
28
|
+
"X-Real-IP": ip,
|
|
29
|
+
"X-Originating-IP": ip,
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
# 缓存的 Session 及其对应的配置版本
|
|
17
33
|
_cached_session = None
|
|
18
34
|
_cached_version = -1
|
|
@@ -69,15 +85,23 @@ def get_session() -> requests.Session:
|
|
|
69
85
|
return session
|
|
70
86
|
|
|
71
87
|
|
|
88
|
+
def _merge_spoof_headers(headers: dict = None) -> dict:
|
|
89
|
+
"""将伪造来源 IP 请求头合并到用户指定的 headers 中(每次请求生成新的随机 IP)"""
|
|
90
|
+
merged = _spoof_ip_headers()
|
|
91
|
+
if headers:
|
|
92
|
+
merged.update(headers)
|
|
93
|
+
return merged
|
|
94
|
+
|
|
95
|
+
|
|
72
96
|
def get(url: str, headers: dict = None, timeout: int = None, **kwargs) -> requests.Response:
|
|
73
|
-
"""带全局配置的 GET
|
|
97
|
+
"""带全局配置的 GET 请求(自动注入伪造来源 IP 请求头)"""
|
|
74
98
|
session = get_session()
|
|
75
99
|
effective_timeout = timeout if timeout is not None else _cached_timeout
|
|
76
|
-
return session.get(url, headers=headers, timeout=effective_timeout, **kwargs)
|
|
100
|
+
return session.get(url, headers=_merge_spoof_headers(headers), timeout=effective_timeout, **kwargs)
|
|
77
101
|
|
|
78
102
|
|
|
79
103
|
def post(url: str, headers: dict = None, timeout: int = None, **kwargs) -> requests.Response:
|
|
80
|
-
"""带全局配置的 POST
|
|
104
|
+
"""带全局配置的 POST 请求(自动注入伪造来源 IP 请求头)"""
|
|
81
105
|
session = get_session()
|
|
82
106
|
effective_timeout = timeout if timeout is not None else _cached_timeout
|
|
83
|
-
return session.post(url, headers=headers, timeout=effective_timeout, **kwargs)
|
|
107
|
+
return session.post(url, headers=_merge_spoof_headers(headers), timeout=effective_timeout, **kwargs)
|