1.必须在登陆后的浏览器中进行http请求
2.请求地址: http://cj.hnu.edu.cn/LMS/ajax/coursePlayer/onlineCoursePlayer.do?courseNumer=10160&courseType=3&href=HNU_10160_04.mp4&requiredTime=45&location=beforeunload&url=http://222.240.166.3:8089/coursePlayer/init.do&status=incomplete&totalTime=19&id=4046&staffChapterId=2837077&courseId=1
参数 | 说明 |
---|---|
courseNumer | 课程序号,每个课程唯一 |
href | 每节课的视频名称, 课程号和节的序号组成 |
id | 每个视频的id,自增 |
staffChapterId | 自增字段 |
courseId | 确定的字段 |
3.参数说明:
参数 | 说明 |
---|---|
courseNumer | 课程序号,每个课程唯一 |
href | 每节课的视频名称, 课程号和节的序号组成 |
id | 每个视频的id,自增 |
staffChapterId | 自增字段 |
courseId | 确定的字段 |
3.请求脚本:
let sessionIds = [];
let xr = new XMLHttpRequest();
xr.onload = function() {
if(xr.status == 200){
sessionIds.push(xr.responseText)
}
}
let nm = 30;
let courseNumer= 10160;
let href_prefix = 'HNU_'+courseNumer+'_';
let href_suffix = '.mp4';
let id_start = 4043;
let staffChapterId = 2837074;
for(let i = 0;i<nm;i++){
let url = 'http://cj.hnu.edu.cn/LMS/ajax/coursePlayer/onlineCoursePlayer.do?';
url += 'courseNumer=' + courseNumer;
url += '&courseType=3';
if(i<9){
url += '&href=' + href_prefix + '0' + (i+1) + href_suffix;
}else {
url += '&href=' + href_prefix + (i+1) + href_suffix;
}
url += '&requiredTime=45&location=beforeunload&url=http://222.240.166.3:8089/coursePlayer/init.do';
url += '&status=incomplete&totalTime=19';
url += '&id='+ (id_start+i);
url += '&staffChapterId='+(staffChapterId+i);
url += '&courseId=1';
xr.open('GET',url,false);
xr.send(null);
}
let sessionStr = '';
for(let j=0;j<sessionIds.length;j++){
sessionStr += sessionIds[j] + '\n';
}
console.log(sessionStr);
code2
sessionIds = [];
xr = new XMLHttpRequest();
xr.onload = function() {
if(xr.status == 200){
sessionIds.push(xr.responseText)
}
}
nm = 30; //节数
courseNumer= 10160;
href_prefix = 'HNU_'+courseNumer+'_';
href_suffix = '.mp4';
id_start = 4043;
staffChapterId = 2837074;
for(let i = 0;i<nm;i++){
let url = 'http://cj.hnu.edu.cn/LMS/ajax/coursePlayer/onlineCoursePlayer.do?';
url += 'courseNumer=' + courseNumer;
url += '&courseType=3';
if(i<9){
url += '&href=' + href_prefix + '0' + (i+1) + href_suffix;
}else {
url += '&href=' + href_prefix + (i+1) + href_suffix;
}
url += '&requiredTime=45&location=beforeunload&url=http://222.240.166.3:8089/coursePlayer/init.do';
url += '&status=incomplete&totalTime=19';
url += '&id='+ (id_start+i);
url += '&staffChapterId='+(staffChapterId+i);
url += '&courseId=1';
xr.open('GET',url,false);
xr.send(null);
}
sessionStr = '';
for(let j=0;j<sessionIds.length;j++){
sessionStr += sessionIds[j] + '\n';
for(let k=0;k<20;k++){
let url = 'http://222.240.166.3:8089/coursePlayer/loopCommit.do?student_id=25006&lesson_location=14&lesson_status=incomplete&score=0.0&suspend_data=&session_time=00%3A00%3A30&lesson_progress=0.0&masteryscore=&total_time=13&required_time=1&session_id=';
url+= sessionIds[j];
xr.open('POST',url);
xr.send(null);
}
}
console.log(sessionStr);