-
Notifications
You must be signed in to change notification settings - Fork 1
/
yuge_yaoqing.py
118 lines (99 loc) · 4.35 KB
/
yuge_yaoqing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# -*- coding: utf-8 -*-
import requests
import string
import random
import time
from requests.utils import dict_from_cookiejar
import re
proxies = {
'http': 'http://taxtask:[email protected]:9068',
# 'https': 'https://taxtask:[email protected]:9068'
}
cou = 0
headers = {
"Host": "yuge-admin.orence.cn",
"Connection": "keep-alive",
"Content-Length": "0",
"sec-ch-ua": "\"Microsoft Edge\";v=\"113\", \"Chromium\";v=\"113\", \"Not-A.Brand\";v=\"24\"",
"sec-ch-ua-mobile": "?0",
"Authorization": "Bearer undefined",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42",
"sec-ch-ua-platform": "\"Windows\"",
"Accept": "*/*",
"Origin": "https://yuge.orence.cn",
"Sec-Fetch-Site": "same-site",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Dest": "empty",
"Referer": "https://yuge.orence.cn/",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9"
}
h1 = {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-encoding": "gzip, deflate, br",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
"cache-control": "max-age=0",
"sec-ch-ua": "\"Microsoft Edge\";v=\"113\", \"Chromium\";v=\"113\", \"Not-A.Brand\";v=\"24\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "same-origin",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.57"
}
session = requests.Session()
session1 = requests.Session()
email_af = ['nqmo.com', 'qabq.com', 'uuf.me', "yzm.de", "end.tw"]
for _ in range(200):
try:
email_af_str = random.choice(email_af)
letters = string.ascii_lowercase
email_be = ''.join(random.choice(letters) for i in range(7))
email = f"{email_be}@{email_af_str}"
print(email)
send_url = f'https://yuge-admin.orence.cn/api/send_email?email={email}'
res = session.post(send_url, headers=headers,proxies=proxies)
print(res.json())
# 刷新邮件
time.sleep(5)
response = session1.get('https://mail.cx/zh/', headers=h1, proxies=proxies)
# 获取响应中的cookie字典
cookie_dict = dict_from_cookiejar(response.cookies)
authorization = cookie_dict['auth_token'].replace('%22', '').replace('%0A', '')
headers1 = {
"authority": "mail.cx",
"accept": "*/*",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
"authorization": "bearer " + authorization,
"referer": "https://mail.cx/zh/",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48"
}
url = f"https://mail.cx/api/api/v1/mailbox/{email_be}@{email_af_str}"
respons = session1.get(url, headers=headers1, proxies=proxies)
print(respons.text)
# 取邮件中的值
mid = respons.json()[0]['id']
# 查看邮箱信息
headers = {
"authority": "mail.cx",
"accept": "*/*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "bearer " + authorization,
"referer": "https://mail.cx/zh/",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48"
}
url = f"https://mail.cx/api/api/v1/mailbox/{email}/{mid}/"
response = session1.get(url, headers=headers, proxies=proxies)
email_code = re.findall(r'输入此次验证码 (\d+) (3分钟内有效)', response.json()['body']['text'])[0]
url = f"https://yuge-admin.orence.cn/api/register?name={email_be}&email={email}&password=88888888&email_code={email_code}&invite_code=QXG6PA"
res = session.post(url, headers=headers,proxies=proxies)
print(res.json())
if '注册成功' in str(res.text):
print('注册成功')
cou += 1
if cou == 81:
break
except:
continue