您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
主要用于检测尔雅通识课的视频完成播放自动进入下一章
// ==UserScript== // @name 【√】尔雅通识课视频学习完成自动翻页 // @namespace ScriptTurnPages:[email protected] // @version 1.3 // @description 主要用于检测尔雅通识课的视频完成播放自动进入下一章 // @author ShenHaiSu // @match https://mooc1.chaoxing.com/mycourse/studentstudy* // @match https://mooc1-1.chaoxing.com/mycourse/studentstudy* // @match https://mooc1-3.chaoxing.com/mycourse/studentstudy* // @icon https://www.google.com/s2/favicons?domain=mju.edu.cn // @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js // @license MIT // ==/UserScript== (function () { let waitTime = 2000 //页面加载后2000毫秒开始运行脚本 let onceTime = 5000 //单次循环检测5000毫秒进行一次 let waitWorkTime = 180 //180秒)三分钟等待时间。等待答题的总计时间,如果超过这个时间,将会直接跳下一页。不等待继续答题。 let nowWorkTime = 0 let videoOnRun = false; setTimeout(() => { console.log("神海粟的脚本开始运行") // 删除不可点击的章节名的class防止误点击 function removeOtherClass() { $("#_studystate").next().children().each(function () { $(this).children(":first").removeClass("posCatalog_select") }) } function clickVideo() { // 自动播放部分代码 if (!videoOnRun) { videoOnRun = true; let videoPlayer = $("#iframe").contents().find("iframe").contents().find("#video_html5_api") for (let videoPlayerKey in videoPlayer) { console.log(videoPlayer[videoPlayerKey]) } } } setInterval(() => { let $active = $(".prev_ul .active").eq(0); removeOtherClass() function ifLasttab() { // 检测当前是否处于最后一个Tab页并点击下一页 // 当前tab页的索引 // console.log($active.index()) // 当前tab页一共有多少个兄弟元素 // console.log($active.parent().children().length-1) if (($active.index()) == ($active.parent().children().length - 1)) { // 当前是最后一的tab页 $(".posCatalog_select").eq($(".posCatalog_active").index(".posCatalog_select") + 1).children(":first").click() } else { // 当前不是最后个tab页,什么都不做。 // console.log("当前不是最后一tab页,继续向后翻页") $active.parent().children().eq($active.index() + 1).click(); videoOnRun = false; } } if ($active[0].innerText.match(/学习目标/g)) { // 当前位于学习目标 console.log("当前位于学习目标,无内容,立即跳过") ifLasttab() } else if ($active[0].innerText.match(/视频/g)) { // 当前位于视频 if (($("#iframe").contents().find(".ans-job-finished")).length == 0) { console.log("任务点未完成"); clickVideo(); } else { console.log("任务点已完成"); ifLasttab() } } else if ($active[0].innerText.match(/章节测验/g)) { // 当前位于章节测验 if (($("#iframe").contents().find(".ans-job-finished")).length == 0) { console.log("任务点未完成" + nowWorkTime) if (nowWorkTime <= waitWorkTime) { nowWorkTime = nowWorkTime + 5 } else { ifLasttab() nowWorkTime = 0 } } else { console.log("任务点已完成") ifLasttab() } } else { // 当前位于通用适配 if (($("#iframe").contents().find(".ans-job-finished")).length == 0) { console.log("任务点未完成") } else { console.log("任务点已完成") ifLasttab() } } }, onceTime); }, waitTime); })();