forked from zz112116/Steam
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
238 lines (193 loc) · 8.22 KB
/
Copy pathtest.py
File metadata and controls
238 lines (193 loc) · 8.22 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
from time import sleep
import timeout_decorator
import random
import pyautogui
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
options = webdriver.ChromeOptions()
# 设置代理
options.add_extension('Buste1.3.1.0.crx')
# proxy = '127.0.0.1:24000'
# print(proxy)
# options.add_argument('--proxy-server=%s' % proxy)
driver = webdriver.Chrome('chromedriver.exe', options=options)
driver.maximize_window()
driver.get('chrome://settings/clearBrowserData')
driver.find_element_by_xpath('//settings-ui').send_keys(Keys.ENTER)
def is_number(s):
try:
float(s)
return True
except ValueError:
pass
try:
import unicodedata
unicodedata.numeric(s)
return True
except (TypeError, ValueError):
pass
return False
def 关闭网页():
driver.quit()
def 关闭当前窗口():
driver.close()
def 邮箱后台登录():
driver.get("http://124.156.0.101:88/")
driver.find_element(By.CSS_SELECTOR,
'#maintable > tbody > tr > td > form > table > tbody > tr > td > input[type=text]:nth-child(4)').send_keys(
"Administrator")
driver.find_element(By.CSS_SELECTOR,
'#maintable > tbody > tr > td > form > table > tbody > tr > td > input[type=password]:nth-child(8)').send_keys(
"zz112116")
driver.find_element(By.CSS_SELECTOR,
"#maintable > tbody > tr > td > form > table > tbody > tr > td > input[type=submit]:nth-child(11)").click()
driver.get("http://124.156.0.101:88/account.php")
def 邮箱注册(邮箱账号, 邮箱密码):
driver.find_element(By.ID,
'zh').send_keys(
邮箱账号)
driver.find_element(By.ID,
'mima').send_keys(
邮箱密码)
driver.find_element(By.CSS_SELECTOR,
"#add").click()
driver.find_element(By.CSS_SELECTOR,
"body > div:nth-child(6) > a").click()
def 获取随机8位():
driver.get("https://www.yalala.com/")
driver.find_element(By.CSS_SELECTOR, "#app > section.bg-container > header > ul > li:nth-child(3) > a").click()
driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > div > div.pwd-digits > button:nth-child(1)").click()
driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > div > div.pwd-check > label > input[type=checkbox]:nth-child(3)").click()
driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > label.operation > button.refresh").click()
suiji = driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > label.pwd-show > input").get_attribute(
'value')
shouzimu = suiji[0]
while is_number(shouzimu):
driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > label.operation > button.refresh").click()
suiji = driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > label.pwd-show > input").get_attribute(
'value')
shouzimu = suiji[0]
driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > label.operation > button.refresh").click()
suiji2 = driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > label.pwd-show > input").get_attribute(
'value')
shouzimu = suiji2[0]
while is_number(shouzimu):
driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > label.operation > button.refresh").click()
suiji2 = driver.find_element(By.CSS_SELECTOR,
"#app > section.bg-container > header > ul > li:nth-child(3) > aside > div > label.pwd-show > input").get_attribute(
'value')
shouzimu = suiji2[0]
return suiji, suiji2
def 写入txt(a):
with open('steam账号.txt', 'a') as st:
st.write(a)
st.close()
def 写入邮箱账号(邮箱账号, 邮箱密码):
邮箱账号 += '@wleizz.com'
邮箱账号 += '----'
邮箱账号 += 邮箱密码
邮箱账号 += '----'
print(邮箱账号)
写入txt(邮箱账号)
def 邮箱注册总():
邮箱账号, 邮箱密码 = 获取随机8位()
写入邮箱账号(邮箱账号, 邮箱密码)
邮箱后台登录()
邮箱注册(邮箱账号, 邮箱密码)
邮箱账号 += '@wleizz.com'
driver.quit()
return 邮箱账号, 邮箱密码
@timeout_decorator.timeout(5)
def mouseClick(img):
while True:
location = pyautogui.locateCenterOnScreen(img, confidence=0.9)
if location is not None:
pyautogui.click(location.x, location.y, clicks=1, interval=0.2, duration=0.2, button="left")
break
sleep(0.1)
def 循环检测(img, time):
i = 0
while i < time:
location = pyautogui.locateCenterOnScreen(img, confidence=0.9)
if location is not None:
return True
sleep(1)
i += 1
return False
def Steam验证码循环点击():
re = "images/01.png"
继续 = "images/03.png"
人 = "images/04.png"
展开 = "images/05.png"
点击 = "images/06.png"
i = 0
mouseClick(点击)
while not 循环检测(展开, 1):
mouseClick(re)
sleep(1)
while i < 5:
mouseClick(人)
if 循环检测(继续, 5):
mouseClick(继续)
break
i += 1
mouseClick(点击)
i = 0
sleep(4)
def Steam注册(邮箱账号):
options2 = webdriver.ChromeOptions()
options2.add_extension('Buste1.3.1.0.crx')
proxy = '127.0.0.1:24000'
print(proxy)
options2.add_argument('--proxy-server=%s' % proxy)
driver2 = webdriver.Chrome('chromedriver.exe', options=options2)
driver2.maximize_window()
driver2.get('chrome://settings/clearBrowserData')
driver2.find_element_by_xpath('//settings-ui').send_keys(Keys.ENTER)
driver2.get("https://store.steampowered.com/join/")
driver2.find_element(By.CSS_SELECTOR,
'#email').send_keys(
邮箱账号)
driver2.find_element(By.CSS_SELECTOR,
'#reenter_email').send_keys(
邮箱账号)
driver2.find_element(By.CSS_SELECTOR,
"#i_agree_check").click()
Steam验证码循环点击()
切换ip(driver2)
def 邮箱登录(邮箱账号, 邮箱密码):
js = 'window.open("http://mail.wleizz.com/");'
driver.execute_script(js)
drivers = driver.window_handles
driver.switch_to.window(drivers[-1])
driver.find_element(By.CSS_SELECTOR,
'#rcmloginuser').send_keys(
邮箱账号)
driver.find_element(By.CSS_SELECTOR,
'#rcmloginpwd').send_keys(
邮箱密码)
driver.find_element(By.CSS_SELECTOR,
"#rcmloginsubmit").click()
def 切换ip(driver):
js = 'window.open("http://127.0.0.1:22999/");'
driver.execute_script(js)
drivers = driver.window_handles
driver.switch_to.window(drivers[-1])
driver.find_element(By.CSS_SELECTOR,
"#react_root > div > div:nth-child(4) > div.page_body.vbox > div > div.panels > div.proxies.proxies_wrapper > div.main_panel.vbox.cp_panel.proxies_panel > div.main_panel.vbox > div > div:nth-child(1) > div > div.ReactVirtualized__Grid.ReactVirtualized__Table__Grid > div > div > div:nth-child(2) > span > div > div.action_icon.cp_icon.refresh").click()
if __name__ == "__main__":
邮箱账号, 邮箱密码 = 邮箱注册总()
Steam注册(邮箱账号)
# 邮箱登录(邮箱账号, 邮箱密码)