// ==UserScript== // @name 麦能网刷课脚本 // @namespace com.kk.icu // @match http://edu.jobingedu.com/lms/web/course/* // @grant none // @version 1.3 // @author KK(kk996icu@qq.com) // @description 2021/12/13 下午8:37:23 // @downloadURL none // ==/UserScript== (function() { 'use strict'; //获取当前页面 const a = $('', { href: window.location.search })[0].baseURI const b = a.substr(a.lastIndexOf('/')+1, 5); let flag = false if(b != 'index') { setTimeout(function(){ setTimeout(function() { let video_list = document.querySelector("#mulu_1") let atPresent = document.querySelector(".view_c_title") let last = video_list.children[video_list.children.length -1].children[1].children[0].title let video = document.querySelector("video"); if(video != null) { if(video.currentTime < video.duration) { video.currentTime = video.duration } } flag = localStorage.getItem("flag") if(atPresent.textContent == last && flag) { let first = video_list.children[0].children[1].children[0].href localStorage.setItem("flag", false) window.location.href = first return; } if(atPresent.textContent == last) { localStorage.setItem("flag", false) window.location.href = "http://edu.jobingedu.com/lms/web/course/index" }else { setTimeout(function() { let button = document.querySelector("#job_nextvideo_btn"); button.click() }, 1500) } }, 1000) }, 1000) }else { setTimeout(function() { const courselist = document.querySelector('#course_list') for (let i = 0; i < courselist.children.length -1; i++) { const course = courselist.children[i] const course_name = course.children[0].children[1].children[0] const temp = course_name.children[0].textContent const key = course.children[0].children[1].children[2].children[0].href const value = course.children[0].children[0].children[0].querySelector('font').textContent if(value != "100%" && temp == "已开课") { localStorage.setItem("flag", true) window.location.href = key } } }, 10000) } })();