好友
阅读权限10
听众
最后登录1970-1-1
|
首先是最开始用代码,paython整合请求发送(已经失效)
# 浏览器头
headers = {
'xm-sign': '84238e93a32e0ef9d034c1bb0f370589(60)1559322977888(79)1559322979692',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36'
}
def get_lessid(userid, zid,jgid):
url = 'https://www.ixueto.com/ashxV3/jigou.ashx'
data = {
'action': 'ztlesslist',
'jgid': jgid,
'ztid': zid,
'userid': userid,
'page': 1,
'rows': 100
}
r = requests.post(url, data, headers=headers)
text = r.text
# print(text)
urls = re.findall(r'<a href=\\"(.*?)\\" class=', text)
lessid = re.findall(r"id=\d*&ztid=", text)
# print(lessid)
for i in range(0, len(lessid)):
print(str(userid) + ' ' + '正在进行:' + str(i + 1) + '/' + str(len(lessid)))
ws = requests.get(urls, headers=headers)
# print(ws.text)
id = re.findall('\d+', lessid)
# print(id[0])
# time.sleep(0.5)
allTime = get_allTim(userid, zid, int(id[0]))
# print(allTime)
# time.sleep(0.5)
get_go(userid, zid, int(id[0]), int(allTime))
# time.sleep(0.5)
def get_allTim(userid, zid, lessid):
url = 'https://www.ixueto.com/ashx/course.ashx'
data = {
'action': 'getCourseTime',
'lessid': lessid,
'stuuid': userid,
'ztid': zid,
}
r = requests.post(url, data, headers=headers)
text = r.text
# print(text)
allTime = re.findall(r'"allTime":\d*,"flag"', text)
a = re.findall('\d+', allTime[0])
return a[0]
def get_go(userid, zid, lessid, xxtimes):
url = 'https://www.ixueto.com/ashx/course.ashx'
data = {
'action': 'updatetimes',
'lessid': lessid,
'xxtimes': int(xxtimes), # time
'stuuid': userid,
'phone': 1,
'ztid': zid,
}
r = requests.post(url, data, headers=headers)
text = r.text
print(str(userid) + ' ' + text)
# 启动
def run():
# 这些ID是从代码整理出来的
# 计算机学院
jisuanji = 1045
jisuanjiG = 170
jisuanji2 = 572
# 人文学院
renwen = 700
renwenG = 82
# 机床
jichuang = 611
jichuangG = 58
# 护理学院
huli = 590
huliG = 51
# 商学院
shangxue = 896
shangxueG = 118
yuying = 662
yuyingG = 78
# 这是多线程
t1 = threading.Thread(
target=get_lessid,args=(用户的userId, huli,huliG)
)
t2 = threading.Thread(
target=get_lessid,args=(用户的userId, yuying,yuyingG)
)
t3 = threading.Thread(
target=get_lessid,args=(用户的userId, huli,huliG)
)
t4 = threading.Thread(
target=get_lessid,args=(用户的userId, shangxue,shangxueG)
)
t5 = threading.Thread(
target=get_lessid,args=(用户的userId, yuying,yuyingG)
)
t6 = threading.Thread(
target=get_lessid,args=(用户的userId, huli,huliG)
)
t7 = threading.Thread(
target=get_lessid,args=(用户的userId, yuying,yuyingG)
)
t8 = threading.Thread(
target=get_lessid,args=(用户的userId, yuying,yuyingG)
)
t9 = threading.Thread(
target=get_lessid,args=(用户的userId, huli,huliG)
)
t10 = threading.Thread(
target=get_lessid,args=(用户的userId,jisuanji,jisuanjiG)
)
t1.start()
t2.start()
t3.start()
t4.start()
t5.start()
t6.start()
t7.start()
t8.start()
t9.start()
t10.start()
t1.join()
t2.join()
t3.join()
t4.join()
t5.join()
t6.join()
t7.join()
t8.join()
t9.join()
t10.join()
def main():
run()
# runAll()
if __name__ == '__main__':
main()
然后改进了开头的发送需要去拿请求头(忽行忽不行的)
def get_lessid(userid, zid,jgid):
url = 'https://www.ixueto.com/ashxV3/jigou.ashx'
data = {
'action': 'ztlesslist',
'jgid': jgid,
'ztid': zid,
'userid': userid,
'page': 1,
'rows': 100
}
r = requests.post(url, data, headers=headers)
text = r.text
# print(text)
urls = re.findall(r'<a href=\\"(.*?)\\" class=', text)
lessid = re.findall(r"id=\d*&ztid=", text)
# print(lessid)
for i in range(50, len(lessid)):
print(str(userid) + ' ' + '正在进行:' + str(i + 1) + '/' + str(len(lessid)))
headers1 = {
'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.9',
'Accept-Encoding': 'gzip, deflate, br',
"Accept-Language": 'zh-CN,zh;q=0.9',
'Connection': 'keep-alive',
'Cookie': 'route=3123acce8c3aeda761b49021553824a1; ASP.NET_SessionId=zwthdywguwjigsuvp0h3mcft; Hm_lvt_06da446a6720c75c82776058c2f7533c=1585580653; luid_en=F9F4DF72981D80A7; xk-xtapp=uid=kIAWEGqXLO8%3d&username=LpkS71NusltXzIM6kWpduQ%3d%3d®type=UjLWC4hD9B0%3d&strztid=Zz7oP4Q7yso%3d&jgid=K%2fUZ9w7vPIE%3d&pid=Zz7oP4Q7yso%3d; BEC=fb173c5f9df4b21ba8f316a79d986831; Hm_lpvt_06da446a6720c75c82776058c2f7533c=1586845903',
'Host': 'www.ixueto.com',
'Referer': lessid,
'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 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36 OPR/67.0.3575.115 (Edition B2)'
}
ws = requests.get(urls, headers=headers1)
# print(ws.text)
print(ws)
id = re.findall('\d+', lessid)
# print(id[0])
# time.sleep(0.5)
allTime = get_allTim(userid, zid, int(id[0]))
# print(allTime)
# time.sleep(0.5)
get_go(userid, zid, int(id[0]), int(allTime),headers1)
time.sleep(1)
下面是上面使用的数值ID
header1 (图片穿不上来),拿的是打开课程的那个GET请求
还有个油猴子的脚本,点那个摄像头三个字 +300秒 多点两下就行,他是判断 >= 时间
今下午试了下好像可以,但是切换频率很快的话就提示你请勿刷课
// ==UserScript==
// @name 1
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @AuThor You
// @match https://www.ixueto.com/*
// @match http://www.ixueto.com/*
// @match https://ixueto.com/*
// @match http://ixueto.com/*
// @grant none
// ==/UserScript==
(function() {
$('#selVideo').click(function(){
overTime +=300;
});
// Your code here...
})();
|
|