南平市网络培训远程教育平台刷课脚本
配置完脚本后,首先进入课程首页:http://xy.59iedu.com/Course/MyCourse/Index 并停留10秒左右。
点击》》 个人中心 》》 在线学习,停留10秒左右
脚本会自动展开所有章节,以提取所有课程链接。如果没有自动展开,请刷新页面或检查刷课脚本是否已经运行。
停留10秒左右,自动打开课程链接,开始学习,
或者接着点击课程的“进入学习”,浏览器会新开一个标签播放课程。
之后会自动判断该视频是否已经学完,如果学完,就会根据刚才提取的课程链接,
播放下一节。
// ==UserScript==
// @name 南平市网络培训远程教育平台刷课脚本
// @namespace https://greasyfork.org/zh-CN/scripts/411460
// @description 南平市网络培训远程教育平台
// @author happylearn
// @match *://*.59iedu.com/*
// @grant GM_getValue
// @grant GM_setValue
// @version 0.3
// ==/UserScript==
(function() {
'use strict';
// Your code here...
var confirm = function () {
return true;
};
window.confirm = function () {
return true;
};
var lists = new Array();
var ssss = "";
if (window.location.href.indexOf("http://xy.59iedu.com/Course/MyCourse/Index") != -1) {
var chapters = document.getElementsByTagName("img")
for (var i = 0; i < chapters.length; i++) {
if (chapters[i].src.indexOf("xkarrowone.gif") != -1) {
chapters[i].click()
}
}
//在课程学习页面,获取所有链接
window.setTimeout(function () {
var links = document.getElementById("tabsLearning").getElementsByTagName("a")
for (let i = 0; i < links.length; i++) {
var url = links[i].getAttribute("href");
if (url.indexOf("medId") != -1 && url != null){
console.log('正在采集学习网址:' + url);
lists.push(url)
}
//alert(lists)
}
GM_setValue('lists', lists);
var new_url = lists[0];
console.log('即将开始学习:' + new_url);
window.location.href = "http://xy.59iedu.com" + lists[0];
}, 3000);
}
window.setTimeout(function () {
setInterval(function () {
//判断是否需要 跳转到下一节
var current_course
var current_medId
var lists = GM_getValue('lists',[]);
var progress = document.getElementById("div_ProgressBar_value").innerHTML;
console.log('当前学习网址:' + window.location.href + ' 当前学习进度:' + progress);
if (progress == "100%") {
var now_id = window.location.href.split("&medId=")[1]
console.log('当前学习课程号:' + now_id);
console.log(lists);
for (var i =0; i < lists.length;i++){
var s = lists[i];
if (s == null) {
continue;
}
console.log('正在检测学习网址:' + s);
var index = s.indexOf(now_id)
console.log('当前学习网址索引:' + index);
if (index >= 0){
delete lists[i];
GM_setValue('lists', lists);
console.log('删除当前学习网址:' + window.location.href);
break
}
}
for (var j=0;j<lists.length;j++){
var ss = lists[j];
if (ss != null){
console.log('跳转到新的学习网址:'+ ss);
window.location.href = "http://xy.59iedu.com" + ss;
break;
}
}
}
}, 2000)
}, 4000);
})();
打赏采用二维码方式。
