forked from Pullautumn/just_for_happy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkjwj.py
50 lines (48 loc) · 1.93 KB
/
kjwj.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
import requests, json, re
# 配置用户名(一般是邮箱)
username = [
'username1',
'username2'
]
# 配置用户名对应的密码 和上面的username对应上
password = [
'password1',
'password2'
]
for i in range(len(username)):
url = 'https://www.kejiwanjia.com/wp-json/jwt-auth/v1/token'
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',
'origin': 'https://www.kejiwanjia.com',
'referer': 'https://www.kejiwanjia.com/'
}
data = {
'username': f'{username[i]}',
'password': f'{password[i]}'
}
html = requests.post(url=url, headers=headers, data=data)
result = json.loads(html.text)
name = result['name']
token = result['token']
check_url = 'https://www.kejiwanjia.com/wp-json/b2/v1/getUserMission'
sign_url = 'https://www.kejiwanjia.com/wp-json/b2/v1/userMission'
sign_headers = {
'Host': 'www.kejiwanjia.com',
'Connection': 'keep-alive',
'Accept': 'application/json, text/plain, */*',
'authorization': 'Bearer ' + f'{token}',
'cookie': f'b2_token={token};',
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'
}
html_1 = requests.post(url=check_url, headers=sign_headers)
imfo_1 = json.loads(html_1.text)
if imfo_1['mission']['credit'] == 0:
print("开始检查第"+str(i+1)+"个帐号"+ " " + name +"签到")
print("还未签到 开始签到")
html_2 = requests.post(url=sign_url, headers=sign_headers)
imfo_2 = json.loads(html_2.text)
print("签到成功 获得" + imfo_2 + "积分")
else:
print("帐号" + str(i + 1) + " " + name )
print("今天已经签到 获得" + imfo_1['mission']['credit'] + "积分")