智慧树自动刷课代码脚本--Javascript、Jquery

登录后打开课程视频播放
按下F12键或者右键打开审查元素
切换到console栏下
复制粘贴以下指令
回车

var main=$("body");
var msg=$("<li></li>");
var json={
"background":"blue",
"height":"60px",
"padding":"5px",
"top":"80px",
"right":"80px",
"font-size":"16px",
"position": "fixed",
"color":"white"
};
var ti = $("body");
var video = $(".catalogue_ul1 li[id*=video-]");
var i = 1;
var v = 1;
var now = new Date();
var month = now.getMonth()+1;
msg.css(json);
msg.html("<span>\u5df2\u4e3a\u60a8\u5f00\u542f\u81ea\u52a8\u64ad\u653e\u6a21\u5f0f\uff0c\u66f4\u591a\u9ed1\u79d1\u6280\u8bf7\u5173\u6ce8\u006c\u0073\u0069\u0072\u0033\u0034\u0035\u0036\u0037<br><center>"+now.getFullYear()+"-"+month+"-"+now.getDate()+"&nbsp;"+now.getHours()+":"+now.getMinutes()+"</center></span>");
main.append(msg);
video.css("color", "blue");
console.log("已选取" + video.length + "个小节,并已用蓝色标明,请检查是否有遗漏,如有遗漏,概不负责");
setTimeout(function () {
    $('.speedTab15').click();
    $('.volumeIcon').click();
    console.log("已进行静音和1.5倍加速");
}, 3000);
ti.on("DOMNodeInserted", function (e) {
    if (e.target.textContent == "关闭") {
        console.log("检测到第" + i + "个弹题窗口");
        window.setTimeout(function () {
            document.getElementById("tmDialog_iframe").contentWindow.document.getElementsByClassName("answerOption")[0].getElementsByTagName("input")[0].click();
            $(".popbtn_cancel").click();
            console.log("已关闭");
        }, 3000);
        i++;
    } else if (e.target.textContent == "本节视频,累计观看时间『100%』") {
        console.log("检测到视频观看完成,准备跳到下一节");
        $('.next_lesson_bg').find('a').trigger('click');
        console.log("已跳转");
        setTimeout(function () {
            $('.volumeIcon').click();
            $('.speedTab15').click();
            console.log("已进行静音和1.5倍加速");
        }, 6000);
        v++;
        console.log("目前播放了" + v + "个视频");
    }
});

在这里插入图片描述

发布了35 篇原创文章 · 获赞 30 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_43792401/article/details/100676077