只支持选修小节自动播放
当前为
// ==UserScript==
// @name 重庆继续教育选修小节自动播放
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 只支持选修小节自动播放
// @author moxiaoying
// @match https://rcpx.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// var org_text = $('.cl-catalog-playing').text();
var url = 'https://rcpx.21tb.com/els/html/courseStudyItem/courseStudyItem.selectResource.do?host=&vbox_server=http://21tb-video.21tb.com&fromNetWorkSetting=false&chooseHttp=https:&courseType=NEW_COURSE_CENTER&eln_session_id=elnSessionId.5fdbc05182394b04be959d211d6d419d'
var data = 'scoId=' + info.scoId +'&courseId=' + info.courseId + '&firstLoad=true&location=2348.1&elsSign=elnSessionId.5fdbc05182394b04be959d211d6d419d¤t_app_id='
$.ajax({
url: url,
data: data,
async: false,
type: 'post',
dataType: 'json',
success: function(data){
console.log(parseInt(data.minStudyTime));
setTimeout(function(){
window.location.reload();
},1000*60*parseInt(data.minStudyTime));
},
error: function(d){
setInterval(function(){
// var now_text = $('.cl-catalog-playing').text();
var min_time = parseInt($('#minStudyTime').text());
var studied_time = parseInt($('#studiedTime').text());
if(min_time-studied_time<=1){
window.location.reload();
}
console.log('studied_time:'+studied_time+'min_time:'+min_time);
}, 1000*60);
}
});
// Your code here...
})();