This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
44 lines (39 loc) · 1.54 KB
/
main.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
"""
作者:Elli0t
更新于2022.05.06
如要运行需要修改三处代码
"""
import requests
import time
import random
import json
courseUrl = "http://www.jxqingtuan.cn/pub/vol/volClass/current"
url = "http://www.jxqingtuan.cn/pub/vol/volClass/join?accessToken="
courseNumber = 0
headers = {
'Host': 'www.jxqingtuan.cn',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'X-Requested-With': 'XMLHttpRequest',
'Accept-Language': 'zh-cn',
'Accept-Encoding': 'gzip, deflate',
'Content-Type': 'application/json;charset=UTF-8',
'Origin': 'http://osscache.vol.jxmfkj.com',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_8_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.18(0x1800123c) NetType/WIFI Language/zh_CN',
'Connection': 'keep-alive',
'Referer': 'http://www.jxqingtuan.cn/html/h5_index.html'
}
responseCourse = requests.request("GET", courseUrl, headers=headers)
courseNumber = json.loads("{" + responseCourse.text.split("{")[2].split("}")[0] + "}")['id']
# print(courseNumber)
# 第一处:修改班级人数 1-43 人
for i in range(1,44):
i = str(i)
i = i.rjust(2,'0')
# 第二处:修改班级编号:2112 班
peopleNumber = "2112" + i
# 第三处:修改 nid ,具体查看 README.md
payload = '''{"course":"'''+ courseNumber +'''","subOrg":null,"nid":"N0014000210021029","cardNo":"'''+ peopleNumber +'''"}'''
response = requests.request("POST", url, headers=headers, data=payload)
print(peopleNumber)
print(response.text)
time.sleep( random.randint(1,10) )