// ==UserScript== // @name 郑州大学远程教育全自动观看网课视频 // @namespace 好好学习天天向上 // @version 1.6 // @description 剩下来的事件让你做更有意义更开始的事情(最后一次更新) // @author 壹局QQ639446649 // @match http://ols.v.zzu.edu.cn/* // @icon https://gitee.com/yjgame-mark/autoPlayByZhengDa/raw/master/log.png // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js // @downloadURL none // ==/UserScript== (function () { 'use strict'; let dianboArr = [] setInterval(() => { let quxiao = $('.ant-modal-confirm-btns .ant-btn:first span') if (quxiao.length != 0) { quxiao.click() window.location.href = "http://ols.v.zzu.edu.cn/xsd/#/index/dibble"; } if ($('#rcDialogTitle2').length == 1) { $('.ant-modal-close-x').click() } if ($('.videoErrorUrlListBox > .videoErrorUrlListTit').text() == '请尝试切换线路') { window.location.href = "http://ols.v.zzu.edu.cn/xsd/#/index/dibble"; } let dianbo = $(".curriculumCard_headP2__2tuF1") if (dianbo.length != 0) { let fenshu = dianbo.find("span:first span") fenshu.each(function (index, element) { let difen = $(element).text().split("/") if (Number(difen[0]) < 10) { dianboArr.push(fenshu[index]) } }); if (dianboArr.length != 0) { $(dianboArr[0]).click() dianboArr = [] } } let iconClose = $(".video_TreePage__3sCrw > .ant-tree-treenode-switcher-close .ant-tree-switcher-icon"); if (iconClose.length != 0) { iconClose.click() } let iconOpen = $(".video_TreePage__3sCrw > .ant-tree-treenode-switcher-open .ant-tree-switcher-icon"); if (iconOpen.length != 0) { $(".video_start__2y2t5").each(function (index, element) { if ($(element).text() === "视频") { if ($(element).next().text() !== "已完成" || $(element).next().length === 0) { let play = $(".prism-progress-played") if (play.length == 0) { $(element).click(); return false } } } }); } let current = $(".current-time") let duration = $(".duration") if (current.length > 0) { let nowArr = current.text().split(":") let now = parseInt(nowArr[0]) let endArr = duration.text().split(":") let end = parseInt(endArr[0]) let num = now / end * 10 if (num >= 9) { window.location.href = "http://ols.v.zzu.edu.cn/xsd/#/index/dibble"; } } }, 2000); })();