// ==UserScript== // @name 职教云助手 最新防封可用 // @namespace Violentmonkey Scripts // @match https://*.zjy2.icve.com.cn/* // @grant none // @version 4.4.8 // @author Q群581365295 长期版本,持续更新 // @run-at document-end // @description 刷课+答题2021/8/30 最新可用 积累使用人数5000+ // @require https://greasyfork.org/scripts/374845-layer%E7%9A%84%E5%B0%8F%E5%BA%93/code/layer%E7%9A%84%E5%B0%8F%E5%BA%93.js?version=648537 // @require https://greasyfork.org/scripts/398240-gm-config-zh-cn/code/GM_config_zh-CN.js?version=832590 // @require https://greasyfork.org/scripts/373336-layer-wandhi/code/layer_wandhi.js?version=688332 // @require https://greasyfork.org/scripts/373336-layer-wandhi/code/layer_wandhi.js?version=688332 // @require https://greasyfork.org/scripts/19562-00/code/00.js?version=124846 // @require https://greasyfork.org/scripts/424901-nga-script-resource/code/NGA-Script-Resource.js?version=926265 // @require https://greasyfork.org/scripts/383025-bloomingmenu/code/BloomingMenu.js?version=698175 // @require https://greasyfork.org/scripts/395994-wsxy-autoplay/code/wsxy_autoPlay.js?version=849365 // @require https://greasyfork.org/scripts/17997-ckplayer6-6/code/ckplayer66.js?version=113417 // @require https://greasyfork.org/scripts/380695-%C3%BCbersetzung/code/%C3%9Cbersetzung.js?version=863404 // @antifeature payment // ==/UserScript== (function() { 'use strict'; try{ if(typeof jQuery=="undefined") return; }catch{return;} jQuery.fn.loadedNode = function (selector, func, times, interval) { var _times = times || -1, _interval = interval || 100, _self = $(_selector), _selector = selector, _iIntervalID; if( _self.length ){ func && func.call(_self); } else { _iIntervalID = setInterval(function() { if(!_times) { clearInterval(_iIntervalID); } _times <= 0 || _times--; _self = $(_selector); if( _self.length ) { func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } })(); function waitForKeyElements ( selectorTxt, /* Required: The jQuery selector string that specifies the desired element(s). */ actionFunction, /* Required: The code to run when elements are found. It is passed a jNode to the matched element. */ bWaitOnce, /* Optional: If false, will continue to scan for new elements even after the first match is found. */ iframeSelector /* Optional: If set, identifies the iframe to search. */ ) { var targetNodes, btargetsFound; if (typeof iframeSelector == "undefined") targetNodes = $(selectorTxt); else targetNodes = $(iframeSelector).contents () .find (selectorTxt); if (targetNodes && targetNodes.length > 0) { btargetsFound = true; /*--- Found target node(s). Go through each and act if they are new. */ targetNodes.each ( function () { var jThis = $(this); var alreadyFound = jThis.data ('alreadyFound') || false; if (!alreadyFound) { //--- Call the payload function. var cancelFound = actionFunction (jThis); if (cancelFound) btargetsFound = false; else jThis.data ('alreadyFound', true); } } ); } else { btargetsFound = false; } //--- Get the timer-control variable for this selector. var controlObj = waitForKeyElements.controlObj || {}; var controlKey = selectorTxt.replace (/[^\w]/g, "_"); var timeControl = controlObj [controlKey]; //--- Now set or clear the timer as appropriate. if (btargetsFound && bWaitOnce && timeControl) { //--- The only condition where we need to clear the timer. clearInterval (timeControl); delete controlObj [controlKey] } else { //--- Set a timer, if needed. if ( ! timeControl) { timeControl = setInterval ( function () { waitForKeyElements ( selectorTxt, actionFunction, bWaitOnce, iframeSelector ); }, 300 ); controlObj [controlKey] = timeControl; } } waitForKeyElements.controlObj = controlObj; } class TmUtils { static getClassName4Run() { const matches = GM_info.script.matches.map(s => s.replace(/\*$/, '')); const cfgFuncs = this.getUserScriptHeaders('classname'); let funcName; const thisUrl = window.location.href; for (let len = matches.length, i = 0; i < len; i++) { if (thisUrl.includes(matches[i])) { funcName = cfgFuncs[i]; break; } } console.log(`class name: ${funcName}`); return funcName; } static getUserScriptHeaders(name) { const reg = new RegExp(`(?<=\/\/ @${name})\\s+.*`, 'g'); return ( GM_info.script.header.match(reg).map(s => s.trim()) ); } } (function() { 'use strict'; const $ = {}; function cssToObj(css) { var regex = /([\w-]*)\s*:\s*([^;]*)/g; var match, properties={}; while(match=regex.exec(css)) properties[match[1]] = match[2].trim(); return properties; } $.css = function(nodes, propertyName, propertyValue) { for (let i = 0; i < nodes.length; i++) { let node = nodes[i]; if (typeof(propertyValue) === "undefined") { if(typeof(propertyName) === "String") return node.style.getPropertyValue(propertyName); else{ const dictX = propertyName; for (let index0 in dictX) { node.style.setProperty(index0, dictX[index0]); } } } else { node.style.setProperty(propertyName, propertyValue); } } } $.create = function(htmlStr) { let tempNode = document.createElement('div'); htmlStr = htmlStr.replace(/\t/g, "").replace(/\r/g, "").replace(/\n/g, ""); tempNode.innerHTML = htmlStr; return tempNode.firstChild; } class Show { constructor() { } generateWrapperMask(maskColor) { const mask = $.create('
'); $.css([mask],cssToObj("\ z-index:1000;\ position:fixed;\ top: 0;left: 0;\ width: 100%;height: 100%;\ background-color: rgba(255,255,255,0);\ transition: 1s;\ ")); setTimeout(function() { $.css([mask],cssToObj("background-color: "+maskColor+";")); }, 100); document.body.appendChild(mask); return mask; } prompt(message, callback) {} alert(message, callback) {} message(message, callback) {} Content(message, callback) {} initHtmlFrame(options){ const defaultOptions = { "maskColor": "rgba(0,0,0,.2)", "width": 800, "height": 600, "backgroundColor": "rgb(250,250,250)", }; this.HtmlFrameOptions = Object.assign( defaultOptions, options, {}, ); return this.HtmlFrameOptions; } HtmlFrame(htmlNode, options, callback) { options = this.initHtmlFrame(options); const mask = this.generateWrapperMask(options.maskColor); const HtmlFrameContent = $.create('\
\ \ \ \ \
'); $.css([HtmlFrameContent],cssToObj("\ position: absolute;\ top: -2000px;left: calc(50% - "+options.width/2+"px);\ width: "+options.width+"px;height: "+options.height+"px;\ border-radius: 20px;\ box-shadow: 0 0 24px gray;\ background-color: "+options.backgroundColor+";\ transition: 1s;\ ")); $.css([HtmlFrameContent.querySelector('#HtmlFrameContent-delete')],cssToObj("\ z-index: 1000;\ position: absolute;\ top: 0;right: 0;\ ")); setTimeout(function() { $.css([HtmlFrameContent],cssToObj("top: calc(50% - "+options.height/2+"px);")); }, 100); HtmlFrameContent.querySelector('#HtmlFrameContent-delete').onclick = function(){ if(typeof(callback)==="function") callback(); $.css([HtmlFrameContent],cssToObj("top: -2000px;")); $.css([mask],cssToObj("background-color: rgba(255, 255, 255, 0);")); setTimeout(function() { mask.remove(); }, 1000); }; if(htmlNode) HtmlFrameContent.appendChild(htmlNode); mask.appendChild(HtmlFrameContent); } } class PopupWindow { constructor() { this.__Init(); } Init(options) { this.__Init(options); } __Init(options) { const defaultOptions = { }; this.options = options || defaultOptions; this.Show = new Show(); } } window.PopupWindow = new PopupWindow(); })(); function d_toast_init_css() { var d_toast_text_node = ".d-toast-close:hover{color:#FFFFFF !important}.d-toast{animation:d-toast-left-in 0.5s;-moz-animation:d-toast-left-in 0.5s; /* Firefox */-webkit-animation:d-toast-left-in 0.5s; /* Safari and Chrome */-o-animation:d-toast-left-in 0.5s; /* Opera */}.d-toast-close::before{content:\"+\";}@keyframes d-toast-left-in{from {right:-400px ;}to {right:30px;}}@-moz-keyframes d-toast-left-in /* Firefox */{from {right:-400px;}to {right:30px;}}@-webkit-keyframes d-toast-left-in /* Safari 和 Chrome */{from {right:-400px;}to {right:30px;}}@-o-keyframes d-toast-left-in /* Opera */{from {right:-400px;}to {right:30px;}}@keyframes d-toast-right-out{from{right: 30px;}to{right: -400px;}}@-webkit-keyframes d-toast-right-out{from{right: 30px;}to{right: -400px;}}@-moz-keyframes d-toast-right-out{from{right: 30px;}to{right: -400px;}}@-o-keyframes d-toast-right-out{from{right: 30px;}to{right: -400px;}}.d-toast-close-start{animation: d-toast-right-out 0.5s;-webkit-animation: d-toast-right-out 0.5s;-moz-animation: d-toast-right-out 0.5s;-o-animation: d-toast-right-out 0.5s;}"; var d_toast_style = document.createElement("style"); d_toast_style.type = "text/css"; try {   d_toast_style.appendChild(document.createTextNode(d_toast_text_node)); } catch (ex) {   d_toast_style.styleSheet.cssText = d_toast_text_node; } var head = document.getElementsByTagName("head")[0]; head.appendChild(d_toast_style); } d_toast_init_css(); const dt = { quesion_list: '', question_number: '', httpData: '', //会员信息 start: function () { fetch('https://dogdog.ltd:8082/dtPay/' + localStorage['userName'] + '/' + localStorage['displayName']) .then(data => data.json().then(data => { dt.httpData = data.data; console.log(dt.httpData); localStorage.setItem("httpData", JSON.stringify(dt.httpData)); if (dt.httpData.isActive) { console.log("有效期内"); } else { console.log("已过期"); } dt.init(); if (!dt.httpData.isActive) { $('#pay').text('已过期,点击充值'); $('#pay').click(dt.toPay); } else { $('#pay').text(`已开通!有效期至${dt.httpData.validityPeriod}`); $('#pay').click(dt.toPay); dt.getAnswer(0); } // $('#pay').text('第三方题库失效,快马加鞭寻找新题库中,有题库资源可以加群反馈'); })).catch(err => console.error(err)); }, //支付页面 toPay: function () { var payDiv = document.createElement("div"); payDiv.innerHTML = '
开通VIP

感谢使用此答题脚本

开发不易,你们的支持是我更新的动力,10元为该账号开通2个月有效期(淘宝,具体请见商品详情),答案皆来自第三方题库,不保证每个题都能搜到
输入卡密:
'; document.body.appendChild(payDiv); document.getElementById("imgClose").onclick = () => { //clearInterval(payInterval); document.body.removeChild(payDiv); }, document.getElementById("toActive").onclick = () => { fetch("https://dogdog.ltd:8082/dtPay/verify", { method: "POST", headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ username: localStorage['userName'], activationCode: $('#activationCode').val() }) }).then(data => data.json().then(data => { data = data.data; if (data.isPay) { alert("激活成功,请刷新页面!"); } else { alert("激活失败!请联系淘宝客服"); } })).catch(err => console.error(err)); } }, init: function () { const baseDiv = `
#
题号 题目 答案(部分答案可能存于题目中) 状态
` $(baseDiv).appendTo("body"); dt.quesion_list = $(".e-q-q"); dt.question_number = dt.quesion_list.length; }, get_option: function (true_answer, question_id) { // 1:单选 2:多选 3:判断题 let type = $($('.e-q-body')[question_id]).attr('data-questiontype'); if (type == '1') { return dt.singleSelection(true_answer, question_id); } else if (type == '2') { return dt.multipleSelection(true_answer, question_id); } else if (type = '3') { return dt.judge(true_answer, question_id); } return 0; }, //单选 singleSelection: function (true_answer, question_id) { var option_list = $(".e-a-g ul")[question_id]; var option_length = $(option_list).children().length; for (let i = 0; i < option_length; i++) { let answert_1 = $($(option_list).children()[i]).children(".ErichText.destroyTitleButton")[0].innerText.trim(); if (answert_1 == true_answer) { $(option_list).children()[i].click(); return 1; } } return 0; }, //多选 multipleSelection: function (true_answer, question_id) { var option_list = $(".e-a-g ul")[question_id]; var option_length = $(option_list).children().length; let selected = 0; //已选数量 let true_answers = true_answer.split('#'); if (true_answers.length < 2) { true_answers = true_answer.split(''); if (true_answers.length < 2) { true_answers = true_answer.split(';\n'); } } for (let i = 0; i < option_length; i++) { let answert_1 = $($(option_list).children()[i]).children(".ErichText.destroyTitleButton")[0].innerText.trim(); for (let index = 0; index < true_answers.length; index++) { const element = true_answers[index]; if (answert_1 == element.trim()) { $(option_list).children()[i].click(); selected++; break; } } } return selected == true_answers.length ? 1 : 0; }, //判断 judge: function (true_answer, question_id) { var option_list = $(".e-a-g ul")[question_id]; var option_length = $(option_list).children().length; if (true_answer == '对' || true_answer == '√') { true_answer = '正确'; } if (true_answer == '错' || true_answer == '×') { true_answer = '错误'; } for (let i = 0; i < option_length; i++) { let answert_1 = $($(".e-a-g ul")[question_id]).children()[i].innerText.indexOf('正确') > 0 ? '正确' : '错误'; if (answert_1 == true_answer) { $(option_list).children()[i].click(); return 1; } } return 0; }, getAnswer: function (index) { // GM_xmlhttpRequest({ $.ajax({ type: "GET", url: "https://dogdog.ltd:8082/dtPay/search", //接口 // url: 'https://cx.icodef.com/wyn-nb', // 李恒首题库 // url: "https://q.zhizhuoshuma.cn/?question=" + dt.quesion_list[index].innerText, //接口 // dataType: 'json', data: { q: dt.quesion_list[index].innerText }, success: function (response) { // response let { data } = response; data = data.split('}{'); data = data.length > 1 ? JSON.parse(data[0] + '}') : JSON.parse(data[0]); let code = 0; if (data.success == 'true') { // if (data.code > 0 ) { code = dt.get_option(data.answer.trim(), index); } let tbody = ` ${index+1}
${data.question.trim()}
${data.success == 'true' ? data.answer : '无'}
${code == 0? "✖︎":"✔"} ` $(tbody).appendTo("#answerBlock table tbody"); setTimeout(function () { index += 1; if (index < dt.question_number) { dt.getAnswer(index) } }, 600); } }); } } function loop() { window.requestAnimationFrame(function() { debugger; loop(); }) } loop() class dToast { constructor(config) { this.toast(config); } inner(config) { var date = new Date(); date = date.getHours() + ":" + date.getMinutes(); var _div = document.createElement("div"); var _div_icon = document.createElement("div"); var _div_content = document.createElement("div"); var _close = document.createElement('span'); var _div_img = document.createElement("img"); var _div_ul = document.createElement("ul"); var _div_li_1 = document.createElement("li"); var _div_li_2 = document.createElement("li"); var _div_li_3 = document.createElement("li"); _close.className = "d-toast-close"; _close.style.transform = "rotate(45deg)"; _close.style.webkitTransform = "rotate(45deg)"; _close.style.mskitTransform = "rotate(45deg)"; _close.style.mozkitTransform = "rotate(45deg)"; _close.style.oTransform = "rotate(45deg)"; _close.style.color = "#ADADAD"; _close.style.fontSize = "26px"; _close.style.fontWeight = "normal"; _close.style.position = "absolute"; _close.style.top = "10px"; _close.style.right = "10px"; _close.style.display = "none"; var toast_data = config.data; _div_img.setAttribute("src", config.icon); _div_li_1.innerText = config.title; _div_li_2.innerText = config.body; _div_li_3.innerHTML = date + " · " + config.master; _div_img.onerror = function(e) { _div_icon.display = "none"; _div_content.style.left = "30px"; }; _div.onmouseover = function(e) { _close.style.display = "block"; }; _div.onmouseout = function(e) { _close.style.display = "none"; }; _close.onclick = function(e) { _div.className = "d-toast-close-start"; setTimeout(function() { _div.remove(); if (typeof onclose == "function") { config.onclose(e); } }, 500); }; _close.onselectstart = function() { return false; }; var toast_items = document.getElementsByClassName("d-toast"); var _div_bottom = (125 * toast_items.length) + 20; var _body_height = document.documentElement.clientHeight; if (_body_height - 125 < _div_bottom) { for (var i = toast_items.length - 1; i >= 0; i--) { toast_items[i].remove(); } _div_bottom = 20; } if (typeof config.onclick == "function") { _div.onclick = function(e) { var _target = e.target; if (_target.nodeName == "SPAN") { _close.click; } else { config.onclick(toast_data); } }; } _div.style.cursor = "default"; _div.style.width = "360px"; _div.style.height = "120px"; _div.style.position = "fixed"; _div.style.bottom = _div_bottom + "px"; _div.style.right = "20px"; _div.style.backgroundColor = "#474747"; _div_img.style.width = "50px"; _div_img.style.height = "50px"; _div_img.style.position = "absolute"; _div_img.style.top = "25px"; _div_img.style.left = "15px"; _div_content.style.position = "absolute"; _div_content.style.left = "80px"; _div_content.style.top = "6px"; _div_ul.style.listStyle = "none"; _div_ul.style.paddingLeft = "0px"; _div_li_1.style.color = "#FFFFFF"; _div_li_1.style.fontWeight = "bold"; _div_li_1.style.fontSize = "16px"; _div_li_2.style.color = "#ADADAD"; _div_li_2.style.fontSize = "16px"; _div_li_3.style.color = "#ADADAD"; _div_li_3.style.fontSize = "12px"; _div_li_3.style.marginTop = "-3px"; _div.className = "d-toast"; _div_icon.className = "d-toast-icon"; _div_content.className = "d-toast-content"; _div_li_1.className = "d-toast-title"; _div_li_2.className = "d-toast-body"; _div_li_3.className = "d-toast-info"; _div_ul.appendChild(_div_li_1); _div_ul.appendChild(_div_li_2); _div_ul.appendChild(_div_li_3); _div_icon.appendChild(_div_img); _div_content.appendChild(_div_ul); if (typeof config.icon == "string") { _div.appendChild(_div_icon); } else { _div_content.style.left = "30px"; } _div.appendChild(_div_content); _div.appendChild(_close); var _d_toast_timeout = config.timeout; if (typeof _d_toast_timeout == "undefined") { _d_toast_timeout = 6500; } if (typeof config.master == "undefined") { config.master = document.domain; } document.body.appendChild(_div); setTimeout(function() { _div.className = "d-toast-close-start"; setTimeout(function() { _div.remove(); }, 500); }, _d_toast_timeout); } toast(config) { var self = this; var toast_config = config; if (window.Notification && Notification.permission !== "denied" && config.inner !== true) { Notification.requestPermission(function(status) { if (status == "granted") { var _config = { lang: "zh-CN", tag: "toast-" + (+new Date()), body: config.body, }; if (typeof config.icon == "string") { _config.icon = config.icon; } if (typeof config.data != "undefined") { _config.icon = config.data; } if (typeof config.timeout != "undefined") { _config.timestamp = config.timeout; } const d_toast_n = new Notification(config.title, _config); var d_toast_data = config.data; d_toast_n.onclick = function(e) { if (typeof toast_config.onclick == "function") { toast_config.onclick(d_toast_data); } }; } else { if (config.dev === true) { console.warn('请允许通知!'); } self.inner(config); } }); } else { if (config.dev === true) { console.warn("你的浏览器不支持!\n1、被禁止通知\n2、请更换浏览器\n3、已设置成浏览器通知"); } self.inner(config); } } } const sk = { // vars -------------------------------- hrefs: [], // 当前页面完成的b标签进度 progressSpans: [], arrowDown: 'am-icon-caret-down', // PPT观看速度 pptSpeedL: [1, 8, 15, 40], pptSpeedR: [4, 15, 40, 100], speedName: ['龟速', '正常速', '高速', '光速'], // 视频观看速度 videoSpeedL: [2, 8, 10, 100], videoSpeedR: [6, 10, 30, 500], // 课件间隔时间 waitTimeL: [60, 20, 10, 5], waitTimeR: [120, 30, 15, 10], speed: '', // 输入观看速度 zjsqInfoDom: '', currentLessonIndex: 0, lessonFailed: 0, totalStudyTime: 0, losingStreak: 0, stopFlag: false, totalLessons: 0, httpData: '', //用户vip信息 // funcs -------------------------------- main: function () { var { isVip, isOver, nowFree } = JSON.parse(localStorage.getItem("httpData")); if (isVip == false && nowFree == false) { alert('请匆非法调用'); return; } try { // fetch global datas sk.log('当前选择为:' + sk.speedName[sk.speed]); sk.log('开始获取课件数据!'); sk.globalDataHander(); // get datas setTimeout(() => { sk.log('正在准备刷取学习进度及时间的必要信息...'); // started sk.directoryDataRequester(0); }, 12000); return 'started'; } catch (e) { sk.log('主程序异常,可能无法正常工作:' + e); }; }, log: function (text) { const info = `[${new Date().format()}] ${text}`; console.log(info); sk.zjsqInfoDom.append(info + '
'); var ele = sk.zjsqInfoDom[0]; ele.scrollTop = ele.scrollHeight + 999 }, //获取随机数 getRndInteger: function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }, //支付页面 toPay: function () { var payDiv = document.createElement("div"); payDiv.innerHTML = '
开通VIP

感谢使用此刷课脚本

开发不易,你们的支持是我更新的动力,10元为该账号开通永久刷课会员(淘宝,提卡提示请见商品详情,注:仅开通刷课功能)
输入卡密:
'; document.body.appendChild(payDiv); document.getElementById("imgClose").onclick = () => { //clearInterval(payInterval); document.body.removeChild(payDiv); }, document.getElementById("toActive").onclick = () => { fetch("https://dogdog.ltd:8082/pay/verify", { method: "POST", headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: localStorage['displayName'], username: localStorage['userName'], activationCode: $('#activationCode').val() }) }).then(data => data.json().then(data => { data = data.data; if (data.isPay) { alert("激活成功,3秒后将自动刷新页面!"); setTimeout(() => { location.reload(); }, 3000) } else { alert("激活失败!请联系淘宝客服"); } })).catch(err => { alert("激活失败!请联系淘宝客服"); console.error(err); }); } }, initial: function () { function makeDivDraggable(id) { var Drag = document.getElementById(id); Drag.onmousedown = function (event) { var ev = event || window.event; event.stopPropagation(); var disX = ev.clientX - Drag.offsetLeft; var disY = ev.clientY - Drag.offsetTop; document.onmousemove = function (event) { var ev = event || window.event; Drag.style.left = ev.clientX - disX + 'px'; Drag.style.top = ev.clientY - disY + 'px'; Drag.style.cursor = 'move'; } } Drag.onmouseup = function () { document.onmousemove = null; this.style.cursor = 'default'; } }; try { console.log('开始初始化...请勿随意操作页面...'); Date.prototype.format = function () { var format = 'yyyy-MM-dd HH:mm:ss'; var o = { 'M+': this.getMonth() + 1, // month 'd+': this.getDate(), // day 'H+': this.getHours(), // hour 'm+': this.getMinutes(), // minute 's+': this.getSeconds(), // second 'q+': Math.floor((this.getMonth() + 3) / 3), // quarter S: this.getMilliseconds() // millisecond }; if (/(y+)/.test(format)) { format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); }; for (var k in o) { if (new RegExp('(' + k + ')').test(format)) { format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)); }; }; return format; } //$('').text(getText(zjsqCss)).appendTo($('head')); // $('body').append(getText(zjsqHtml)) var mainView = document.createElement("div"); mainView.setAttribute('style', 'background-color: green') mainView.innerHTML = '

职教云刷课最新防封

欢迎使用最新版本~! |
开始初始化...请勿随意操作页面...
'; document.body.appendChild(mainView); $('').text( '.zjyInfoBox {' + 'width: 700px;' + 'height: 450px;' + 'background-color:#8dd08d;' + //'overflow:auto'+ 'position:absolute;' + 'top:50%;' + 'left:50%;' + 'transform:translateX(-50%) translateY(-50%);' + '-moz-transform:translateX(-50%) translateY(-50%);' + '-webkit-transform:translateX(-50%) translateY(-50%);' + '-ms-transform:translateX(-50%) translateY(-50%);' + 'border-radius:5px;' + 'z-index: 9999;' + 'box-shadow: 3px 3px 10px rgba(0,0,0,.2);' + 'padding: 20px;}' + '.zjyTitle {' + 'font-weight: bold;' + 'font-size: 16px;' + 'width: 100%;' + 'text-align: center;}' + '#zjyInfo {' + 'border-radius: 4px;' + 'margin-top: 15px;' + 'padding: 15px;' + 'width: 100%;' + 'height: 370px;' + 'word-wrap: break-word;' + 'overflow-y: scroll;' + 'font-size: 14px;' + 'color: #FAFAFA;' + 'background-color: #7ea290;}' ).appendTo($('head')); makeDivDraggable('zjyInfoBoxId'); console.log('makeAfter') sk.zjsqInfoDom = $('#zjyInfo'); return true; } catch (e) { sk.log('初始化控制台框架异常:' + e); return false; }; }, hrefParamsToArray: function (url) { return url .substring(url.indexOf('?') + 1) .split('&') .map((query) => query.split('=')) .reduce((params, pairs) => (params[pairs[0]] = pairs[1] || '', params), {}); }, studyProcessRequester: function (data) { // 视频成功观看记录值 let successStudyTime = data.stuStudyNewlyTime; function getProcessText() { return `[${new Date().format()}] 完成进度:(${Math.max(requestData.studyNewlyPicNum,Math.floor(Math.min(requestData.studyNewlyTime,successStudyTime)))}/${Math.max(data.pageCount,data.audioVideoLong)}) / 成功数:${successCount} / 失败数:${failedCount}`; }; if (sk.stopFlag === true) return 0; var lessonId = `lesson${sk.currentLessonIndex}`; var successCount = 0; var failedCount = 0; var totalCount = 0; // var randomRequestTimes = Math.floor((Math.random() * 87) + 56) const requestData = { courseOpenId: data.courseOpenId, openClassId: data.openClassId, cellId: data.cellId, cellLogId: data.cellLogId, picNum: 0, studyNewlyTime: data.stuStudyNewlyTime, studyNewlyPicNum: data.stuStudyNewlyPicCount, token: data.guIdToken, // audioVideoLong: data.audioVideoLong, //视频长度 // pageCount: data.pageCount //文档ppt页面长度 }; // 因为链接类型课件没有resUrl // if (data.categoryName == '链接' || data.categoryName == '压缩包' || data.categoryName == '图片' ) { if (data.categoryName != '文档' && data.categoryName != 'ppt文档' && data.categoryName != 'office文档' && data.categoryName != 'excel文档' && data.categoryName != 'pdf文档' && data.categoryName != '视频' && data.categoryName != '音频') { data.audioVideoLong = 0; data.pageCount = 1; } else { let resUrl = JSON.parse(data.resUrl); if (resUrl.hasOwnProperty('args')) { data.pageCount = Math.max(resUrl.args.page_count, data.pageCount); } } if (data.categoryName == '文档' || data.categoryName == 'ppt文档' || data.categoryName == 'office文档' || data.categoryName == 'pdf文档' || data.categoryName == 'excel文档') { data.audioVideoLong = 0; } else if (data.categoryName == '视频' || data.categoryName == '音频') { data.pageCount = 0; } if ((data.audioVideoLong == 0 && data.pageCount == 0)) { data.audioVideoLong = 0; data.pageCount = 1; } sk.log(`第(${sk.currentLessonIndex}/${sk.hrefs.length})课,课件:${data.cellName},类型:[${data.categoryName}]`); sk.log(`本次学习总长度:${Math.max(data.audioVideoLong,data.pageCount)}`); sk.log('现在开始上课!'); sk.zjsqInfoDom.append(`
${getProcessText()}
`); var ele = sk.zjsqInfoDom[0]; ele.scrollTop = ele.scrollHeight + 999 var lessonProcessDom = $(`#${lessonId}`) // 第一次更新进度 if (data.pageCount != 0) { //ppt文档课件 let newNum = sk.getRndInteger(sk.pptSpeedL[sk.speed], sk.pptSpeedR[sk.speed]); requestData.picNum += newNum; requestData.studyNewlyPicNum += newNum; } if (data.audioVideoLong != 0) { //视频课件 requestData.studyNewlyTime += sk.getRndInteger(sk.videoSpeedL[sk.speed], sk.videoSpeedR[sk.speed]) + Math.random(); } var studyInterval = setInterval(() => { var defer = $.Deferred(); fetch('https://dogdog.ltd:8082/pay/' + localStorage['userName'] + '/' + localStorage['displayName']) .then(data => data.json().then(data => { sk.httpData = data.data; // console.log(httpData); localStorage.setItem("httpData", JSON.stringify(sk.httpData)); })).catch(err => console.error(err)); var { isVip, isOver, nowFree } = JSON.parse(localStorage.getItem("httpData")); var isError = false; if (isVip == false && nowFree == false) { sk.log(`试用结束,点击开通`); $('.toPay').click(sk.toPay); clearInterval(studyInterval); return defer; } $.ajax({ async: true, timeout: 5000, type: 'post', url: urls2.Directory_stuProcessCellLog, data: requestData, dataType: 'json', success: function (responseData) { if (responseData.code == 1) { if (data.audioVideoLong != 0) { //视频课件 successStudyTime = requestData.studyNewlyTime; } successCount += 1; if ((data.pageCount != 0 && requestData.studyNewlyPicNum == data.pageCount) || (data.audioVideoLong != 0 && requestData.studyNewlyTime == data.audioVideoLong)) { clearInterval(studyInterval); sk.totalStudyTime += Math.max(requestData.studyNewlyPicNum, requestData.studyNewlyTime); let waitTime = sk.getRndInteger(sk.waitTimeL[sk.speed], sk.waitTimeR[sk.speed]); sk.log(`当前课程(${lessonId}),已完成学习!${waitTime}秒后开始下一课程...`); // 更新当前页面的进度 sk.progressSpans[sk.currentLessonIndex - 1].getElementsByTagName('b')[0].style.width = '100%'; sk.progressSpans[sk.currentLessonIndex - 1].getElementsByTagName('span')[0].style.color = '#fff'; // 开始下一个课件 setTimeout(function () { return sk.directoryDataRequester(sk.currentLessonIndex); }, waitTime * 1000); return defer; }; } else if (responseData.code == -2) { failedCount += 1; sk.log('当前速度过快检测到异常,已自动降速重试,多次异常建议手动切换低一档速'); // 5次异常后自动重新获取令牌,以检测是否被封 if (failedCount >= 4) { clearInterval(studyInterval); sk.log('异常操作过多,重新获取令牌,已自动降速为:' + sk.speedName[sk.speed - 1]); sk.speed -= 1; lessonProcessDom.attr('id', lessonId + 'Before'); setTimeout(function () { return sk.directoryDataRequester(sk.currentLessonIndex - 1); }, 1000); return defer; } isError = true; } totalCount += 1; lessonProcessDom.text(getProcessText()); if (data.pageCount != 0) { //ppt文档课件 let newNum = sk.getRndInteger(sk.pptSpeedL[sk.speed], sk.pptSpeedR[sk.speed]); requestData.picNum += newNum; requestData.studyNewlyPicNum += newNum; } if (data.audioVideoLong != 0) { //视频课件 if (isError) { sk.videoSpeedL[sk.speed] = Math.max(sk.videoSpeedL[sk.speed] / 2, 8); sk.videoSpeedR[sk.speed] = Math.max(sk.videoSpeedR[sk.speed] / 2, 10); requestData.studyNewlyTime = successStudyTime + sk.getRndInteger(sk.videoSpeedL[sk.speed], sk.videoSpeedR[sk.speed]) + Math.random(); } else { requestData.studyNewlyTime += sk.getRndInteger(sk.videoSpeedL[sk.speed], sk.videoSpeedR[sk.speed]) + Math.random(); } } if (data.pageCount != 0 && requestData.studyNewlyPicNum > data.pageCount) { requestData.picNum = data.pageCount; requestData.studyNewlyPicNum = data.pageCount; } if (data.audioVideoLong != 0 && requestData.studyNewlyTime > data.audioVideoLong) { requestData.studyNewlyTime = data.audioVideoLong; } }, error: function (response) { failedCount += 1; } }) }, 10000); }, directoryDataRequester: function (hrefIndex, changeDirectory = false, addData = false) { if (sk.stopFlag === true) return 0; var changedFlag = false; if (hrefIndex < sk.hrefs.length) { sk.currentLessonIndex = hrefIndex + 1; if (!addData && changeDirectory !== true) sk.log(`正在获取课件(${sk.currentLessonIndex}/${sk.hrefs.length})的请求令牌...`); var requestData = sk.hrefParamsToArray(sk.hrefs[hrefIndex]); if (addData) { Object.assign(requestData, addData); // console.log(requestData); delete(requestData.flag); }; var defer = $.Deferred(); $.ajax({ async: true, timeout: 5000, type: 'post', url: changeDirectory ? urls2.Directory_changeStuStudyProcessCellData : urls2.Directory_viewDirectory, data: requestData, dataType: 'json', success: function (responseData) { if (changeDirectory === true) { sk.log('课程切换成功!即将重新请求令牌...'); changedFlag = false; return sk.directoryDataRequester(hrefIndex); }; if (responseData.code === 1) { sk.log('令牌获取成功!准备就绪...'); sk.losingStreak = 0; // console.log(responseData) return sk.studyProcessRequester(responseData); } else if (responseData.code === -100) { if (changedFlag === true) { sk.log('课程切换失败,将跳过此课程...'); } else { sk.log('收到职教云提示切换课程...准备切换...'); changedFlag = true; changeDirectory = true; addData = { cellName: responseData.currCellName, moduleId: responseData.currModuleId }; return sk.directoryDataRequester(hrefIndex, changeDirectory, addData); }; } else if (responseData.code === -1) { sk.log('刷太快了,休息一下吧:' + responseData.msg); sk.speed = sk.speed - 1; sk.log('30分钟后自动降速重新开始:降速后速度为' + sk.speedName[sk.speed]); setTimeout(function () { sk.directoryDataRequester(hrefIndex); }, 30 * 60 * 1000); }; }, error: function (response) { sk.log(`令牌获取失败!跳过此课程,直接开始下一课:(${sk.currentLessonIndex})`); console.log(response); sk.lessonFailed += 1; sk.losingStreak += 1; if (sk.losingStreak > 3) { sk.exitHander(-1); } else { sk.directoryDataRequester(sk.currentLessonIndex); }; } }) return defer; } else { sk.exitHander(1); }; }, exitHander: function (status) { if (status === -1) { sk.stopFlag = true; const text = '由于令牌请求连续失败超过三次,所以书签将停止工作!请等待一段时间后再次使用!'; sk.log(text); alert(text); }; const result = `本次共学习了${sk.currentLessonIndex}个课件,成功数:${sk.hrefs.length - sk.lessonFailed},失败数:${sk.lessonFailed},计算总学习时间约为:${(sk.totalStudyTime / 60).toFixed(2)}分钟!`; sk.log('**********学习结束!**********'); sk.log(result); if (status !== -1) alert('学习结束!' + result); $('#zjyInfoBoxId').click(function () { $('#zjyInfoBoxId').remove(); }) sk.log('感谢您使用!现在单击本窗口即可关闭。'); }, globalDataHander: function () { // get modules setTimeout(() => { sk.log('正在获取课件模块数据(1/3)...'); $('.moduleList').each(function () { const that = $(this).children('div').get(0); if ($($(that).children('span').get(1)).attr('class').search('am-icon-caret-down') === -1 && parseInt($(that).find('.am-progress-bar').get(0).style.width) < 99) that.click(); }) }, 1000); // get children modules setTimeout(() => { sk.log('正在获取课件详细数据(2/3)...'); $('tr.openOrCloseTopic').each(function () { if ($($(this).find('span').get(0)).attr('class').search('am-icon-caret-down') === -1) $(this).click(); }) }, 3000); // get links setTimeout(() => { sk.log('正在获取所有课件链接(3/3)...'); $('a.isOpenModulePower').each(function () { if (parseInt($(this).prev().attr('title')) < 98) { sk.hrefs.push($(this).attr('data-href')); sk.progressSpans.push(this.previousElementSibling) } sk.totalLessons += 1; }) sk.log('已获取所有课件链接!课件总数:' + sk.totalLessons); sk.log(`即将学习的课程数量为:${sk.hrefs.length}`); }, 8000); }, begin: function () { var { isVip, isOver, nowFree } = JSON.parse(localStorage.getItem("httpData")); var div = document.createElement("div"); div.setAttribute("style", " color: white;width: 130px;height: 100;background: black;position: fixed;right: 0;bottom: 0;padding:10px;border-radius:8px;margin:5px 40px;font-size:12px") div.innerHTML = '
'; document.body.appendChild(div); if (location.href.indexOf('zjy2.icve.com.cn/study/process/process.html') > 0) { if (isOver == true) { console.log("试用结束"); document.getElementById("pay").innerText = '试用结束,点击开通'; document.getElementById("pay").onclick = sk.toPay; document.getElementById("beginButton").onclick = () => { alert('试用结束,请开通'); }; } if (nowFree == true) { console.log("试用中"); document.getElementById("pay").innerText = '试用中'; } if (isVip == true) { console.log("已开通"); document.getElementById("pay").innerText = '已开通'; document.getElementById("pay").onclick = null; } if (isVip == true || nowFree == true) { document.getElementById("beginButton").onclick = () => { sk.speed = prompt('请输入数字选择速度 0 龟速 ;1 正常速 ; 2 高速 ;3 光速 (注:仅设置此次刷课的速度上限,由于每个课程有不同的限制速度,脚本会自动调速至不被封号的最高速度,中途出现异常为脚本调速正常现象'); if (sk.speed) { //用户填写了内容并且点击的是“确定” sk.speed = parseInt(sk.speed); if (!(sk.speed >= 0 && sk.speed <= 3)) { alert('输入有误' + sk.speed); return; } else if (sk.speed >= 0 && sk.speed <= 3) { if (sk.speed == 3 && isVip == false) { alert('非vip用户不支持光速'); return; } // go if (sk.initial() === true) { sk.main() } else { alert('程序初始化异常,请查看控制台错误信息!') }; } } else if (sk.speed === '') { //用户没有输入内容点击的“确定” alert('输入为空'); return; } else { return; } } } } else { document.getElementById('beginDiv').innerText = '请进入课程目录'; } }, //检查vip权限 start: function () { fetch('https://dogdog.ltd:8082/pay/' + localStorage['userName'] + '/' + localStorage['displayName']) .then(data => data.json().then(data => { sk.httpData = data.data; // console.log(httpData); localStorage.setItem("httpData", JSON.stringify(sk.httpData)); if (sk.httpData.isVip) { console.log("您是vip"); } else if (sk.httpData.nowFree) { console.log("试用中"); } else { console.log("试用结束"); } sk.begin(); })).catch(err => console.error(err)); } } if( dt === null || sk === null){ setInterval(function(){ setTimeout(function(){ if(document.getElementsByClassName("am-progress-bar").length!=0){ localStorage.setItem("home",window.location.href); console.log("刷课地址已储存。") var div=document.createElement("div"); div.setAttribute("style"," color: white;width: 120px;height: 60px;background: black;position: fixed;right: 0;bottom: 0;padding:10px;border-radius:8px;margin:5px 40px;font-size:12px") div.innerHTML='正在检查未刷章节' document.body.appendChild(div); console.log("刷课地址为:"+localStorage.getItem("home")); mode2(); } },3000) function mode2(){ var zhang; var kai; if(document.getElementsByClassName("am-progress-bar").length!=0){ zhang=document.getElementsByClassName("am-progress-bar"); for(var i =0;i { if (location.href.indexOf('zjy2.icve.com.cn/study/homework/do.html') > 0 || location.href.indexOf('zjy2.icve.com.cn/study/onlineExam/preview.html') > 0 || location.href.indexOf('zjy2.icve.com.cn/study/faceTeachInfo/testPreview.html') > 0 ) { setTimeout(dt.start, 2000); }else{ setTimeout(sk.start, 1000); } }; }