-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmiui.py
56 lines (44 loc) · 1.34 KB
/
miui.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
#变量名 miui
#值 账号:密码
import requests
import os
import urllib3
import http.cookies
import re
urllib3.disable_warnings()
credentials = os.environ.get('miui')
if credentials:
for credential in credentials.split('#'):
username, userpass = credential.split(':')
print('账号:', username)
headers = {
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Host': 'miuiver.com',
}
data = {
'log': username,
'pwd': userpass,
'action': 'mobantu_login',
}
response = requests.post('https://miuiver.com/wp-content/plugins/erphplogin//action/login.php', headers=headers, data=data, verify=False)
cookie_value = re.findall(r'wordpress_logged_in_\w+[^;]+', response.headers['Set-Cookie'])[0]
cookies = {'wordpress_logged_in': cookie_value}
headers2 = {
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
'cookie': cookie_value ,
'Host': 'miuiver.com',
}
data2 = {
'action': 'epd_checkin',
}
response2 = requests.post('https://miuiver.com/wp-admin/admin-ajax.php', headers=headers2, data=data2, verify=False)
if response2.status_code == 200:
result = response2.json()
if result['status'] == 201:
print('已经签到过了')
elif result['status'] == 200:
print('已签到')
else:
print('签到失败')
else:
print(response2.text)