您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
刷课
// ==UserScript== // @name xjtudj // @namespace http://tampermonkey.net/ // @version 0.3 // @description 刷课 // @author cho // @match http://xjtudj.edu.cn/course_detail.html?navId=course_list* // @match http://xjtudj.edu.cn/djnfo.html?navId=zone_index&zTempId=learnPlan* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // ==/UserScript== (function () { 'use strict'; function updatalist() { var id = Number(sessionStorage.getItem("playid")); sessionStorage.removeItem("playid"); id = id + 1 sessionStorage.setItem('playid', id); } function openlist() { if (sessionStorage.getItem(sessionStorage.getItem("playid")) == null) { alert("没有课程") } else { setTimeout(function () { window.location.href = sessionStorage.getItem(sessionStorage.getItem("playid")); }, 500); } } function fakeplay() { var reg = /course_detail\.html\?navId=course_list\&courseId=([a-z0-9]{32})\&coursewareId=([a-z0-9]{32})$/; var msg = reg.exec(window.location.href); if (msg != null) { var courseId = msg[1]; var coursewareId = msg[2]; safePostAsy($host + '/client/course/getLearnedHistory', { "courseId": courseId, "coursewareId": coursewareId, "progress": 0 }, function (res) { if (res.isSuccess) { if (coursewareId == res.data.coursewareId) { var DuringTime = res.data.courseAllTime if (DuringTime > 0) { safePost($host + '/client/course/setFinished', { "courseId": courseId, "coursewareId": coursewareId, "progress": DuringTime }, function (res) { if (res.isSuccess) { if (coursewareId == res.data.coursewareId) { var progressHtml = ""; progressHtml = "<div class='progress-o'>本集学习进度<i>" + res.data.rateStr + '%' + "</i></div>" + "<div class='progress-t'>" + "<div class='progress-t-0' style='width: " + res.data.rateStr + "%;'></div></div>"; $("#progressBar").html(progressHtml); setTimeout(function () { updatalist(); openlist(); }, 500); } } }) } } } }) var videoElement = document.getElementsByTagName("video")[0]; if (videoElement) { videoElement.pause(); videoElement.removeAttribute('src'); // empty source videoElement.load(); } } } function getlist() { let courseList = document.getElementsByClassName('course_see'); let j = 0; sessionStorage.clear(); for (let i = 0; i < courseList.length; i++) { if (courseList[i].className != "course_see finished") { sessionStorage.setItem(j, courseList[i].href); j++; } } sessionStorage.setItem('playid', 0); } function run() { if (document.getElementsByClassName('loc_font')[0].innerText.indexOf("学习计划") > 0) { setTimeout(function () { getlist(); }, 2000); if (sessionStorage.length == 1) { alert("没有课了"); } else { setTimeout(function () { openlist(); }, 3000); } } else if (document.getElementsByClassName('loc_font')[0].innerText.indexOf("课程资源") > 0) { fakeplay(); } else { "pass" } } setInterval(function () { location.reload() }, 30000); if (document.getElementsByClassName('loc_font')[0].innerText.indexOf("课程资源") > 0) { setTimeout(function () { fakeplay(); }, 1000); } else { window.onload = function () { setTimeout(function () { run(); }, 5000); }; } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址