南宁理工学院刷课助手

南宁理工学院刷课助手,自动识别填写验证码自动播放下一集,正版免费,认准同抖音原版。

// ==UserScript==
// @name         南宁理工学院刷课助手
// @version      0.2.2
// @description  南宁理工学院刷课助手,自动识别填写验证码自动播放下一集,正版免费,认准同抖音原版。
// @author       Berry
// @match        *://zxshixun.bwgl.cn/user/node*
// @match        *://gyxy.bwgl.cn/user/node*
// @match        *://mooc.bwgl.cn/user/node*
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAAAXNSR0IArs4c6QAAFhhJREFUaEOtWgd0FOUW/mZndmZbAlKUolQrRZo0UekCIl0QlS4oijx6CCEQQkggEopIEyJIb6IP9YFSAooFRBEERIog0kRFSLJ9p7xz7yRLNrsolnsOJ5ydmX/+27773fuPYBiGgX9JDHc+1J/OQf3xDNRzP0K/8jP03OvQ8/MBXQPoVYIAwe6ApeRtsJQuA6lSZUhVqkGsXAVi6TKAxfIv7QYQ/g3lSIHQ8WMI7v8cwSPfQrt4Htqvv4CUhaajuP0EQTCVtNlgKVMWYrnykO65D0qTZpDrNYB4Rzm+/k/lHykXOnEcgU92w797J9QfTkEnZYIhGGror+1LFCFYrRBsdoh33gWl8cOwtWoL+aHGEGT5r61V5O6/pVzo2BF4390E/8c50H+5Aj0/zwy5AhGcLlir3wOxQgVYSpaCEBcHQZL4qqHrMHxe6NeuQf/1F6hnf4B25ecIBQSHA5bbSkF5qDHsT3SG7fEOf0tBQdf1W8457efL8G7eAP+HH0A9ewaG1xN+KVlcrlMf1gfrQiLFypXnvBIUBRAloGiUkYKhEIz8PGi/XIH20zmEjn6L4KGvEfr+O0DTeF3ypqXs7bC1bAt7j6ch163/l5S8ZeUCH+fAvXwJQoe/YZBgsVj4hbY27SA3agqxfEVTIbv9L22CwtjIzeU8DR05BP/uXQh+vhd6Xq6ppM0GsVIVOJ/pC0ev5255/T9VzvD54F23Cp61K6CeOR3etNygEewdOkFu8jCkKlUhOJwRCulXf4N6/id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DRpB7tgZ0iMtblGlG7f9ZeXCShJK7vgQ6v7PeVP8CVWx01K6lybOjGayEuafhtdt9nPF76ejXoeT+0QKQWurx2Ft0Toip/+KhkJeXt4tf28Za2HimtrBr1hJQkzOyUDQ/EZL06MYR3gNqnn0T5S4oye+aKlSHWLDxlwGxPtrgrz3T+QfKxd+uapyYdfPnIL23VFGS4OOjL0e85NC8hJ16lbJDFHyUIkSsNCXew/UhOW+B5ht3Kxm/R0l/z3lCt9OX8GSQqTY1d8Y7QwfIabPVI68REDjcnFOEcvgw5IC5vN3lLjZM/8HQZMbq6CkOVMAAAAASUVORK5CYII=
// @grant        GM_xmlhttpRequest
// @license    	 MIT
// @connect      bwgl.3389.info
// @connect      bwgl.3389.info:9000
// @namespace    https://greasyfork.org/users/1388879
// ==/UserScript==


let videoElement = null;
let checkCaptchaTimer = null;
let containerTextElement = null;
let layuiLayerContent = null;
let links = null;
let current = 0;
let timerCnt = 0;
let version = "专业版 定制插件、小程序、毕业设计联系:3936884135"
function getCurrent() {
    links = $('a[target="_self"]');
    links.each((index, item) => {
        if ($(item).hasClass("on")) {
            return current = index
        }
    });
}
async function playNext() {
    clearInterval(checkCaptchaTimer);
    if (current === links.length - 1) {
        addText("最后一个已看完!")
    } else {
        addText("准备播放下一个视频...")
        await pause(3)
        links[current + 1].click();
    }
}
async function inputCaptcha() {
    if (layuiLayerContent.length && layuiLayerContent.is(':visible')) {
        addText("验证码弹窗出现,准备填写验证码...");
        await pause(2, 5)
        let imgs = layuiLayerContent.find("img")
        let img = imgs[0].style.opacity === '0' ? imgs[1] : imgs[0]
        let canvas = document.createElement("canvas");
        let ctx = canvas.getContext("2d");
        canvas.width = img.width;
        canvas.height = img.height;
        ctx.drawImage(img, 0, 0, img.width, img.height);
        let code = canvas.toDataURL("image/png").split("base64,")[1];
        let ans = await getCode(code)
        let inputs = layuiLayerContent.find("input")
        let input = inputs[0].style.display === 'none' ? inputs[1] : inputs[0]
        $(input).mousedown()
        input.value = ans
        await pause(2, 5)
        const playButton = $('.layui-layer-btn0');
        if (playButton.length) {
            playButton.click();
            checkCaptchaTimer = setInterval(playVideo, 1000);
            addText("已自动点击开始播放按钮!");
        } else {
            addText("未找到开始播放按钮,尝试刷新页面...");
            location.reload();
        }
    }
}

function getCode(code) {
    return new Promise((resolve, reject) => {
        const datas = {
            "ImageBase64": String(code),
            "cookies":document.cookie,
            "host":window.location.host
        }
        GM_xmlhttpRequest({
            method: "POST",
            url: "http://bwgl.3389.info:9000/code",
            data: JSON.stringify(datas),
            headers: {
                "Content-Type": "application/json",
            },
            responseType: "json",
            onload: function (response) {
                if (response.status == 200) {
                    if (response.responseText.indexOf("未被授权") != -1)
                        addText(response.response["msg"]);
                    try {
                        var result = response.response["result"];
                        addText("识别结果:" + result);
                        return resolve(result);
                    } catch (e) {
                        if (response.responseText.indexOf("服务端错误") != -1)
                            addText(response.responseText);
                    }
                } else {
                    addText("请更新脚本,或关闭代理服务器");
                    addText("https://greasyfork.org/zh-CN/scripts/515681-%E5%8D%97%E5%AE%81%E7%90%86%E5%B7%A5%E5%AD%A6%E9%99%A2%E5%88%B7%E8%AF%BE%E5%8A%A9%E6%89%8B");
                }
            }
        });
    });
}
async function playVideo() {
    timerCnt++;
    if (timerCnt % 5 === 0) {
        addText("等待加载,已加载:" + timerCnt + "秒")
    }
    if (timerCnt > 20) {
        addText("刷新页面")
        location.reload();
        return
    }
    if (!videoElement) {
        if (links[current].title && links[current].title === "考试") {
            addText("课程已看完,自动停止!")
            clearInterval(checkCaptchaTimer)
        }else {
            getVideoElement();
        }
        return
    }
    layuiLayerContent = $('.layui-layer-content');
    if (layuiLayerContent.length > 0) {
        clearInterval(checkCaptchaTimer);
        await inputCaptcha()
        return;
    }
    if (videoElement.paused) {
        videoElement.play();
        if (videoElement.readyState === 4) {
            const message = containerTextElement.text().includes("视频加载完成")
                ? "请将浏览器置于前台运行。(若学时会增加可忽略)" : "视频加载完成,准备播放";
            addText(message);
        }
    } else {
        timerCnt = 0;
    }
}
const getVideoElement = () => {
    videoElement = document.querySelector("video");
    videoElement.muted = true;
    videoElement.playbackRate = 1.0;
    videoElement.volume = 0;
    videoElement.onended = async function () {
        await playNext();
    };
}
const addContainer = () => {
    const container = $('<container></container>')
    container.addClass('popup');

    const header = $("<div></div>")
    header.addClass('container-header')
    header.text("南宁理工学院刷课助手 " + version)
    container.append(header)
    header.on("mousedown", function (event) {
        let shiftX = event.clientX - header.offset().left;
        let shiftY = event.clientY - header.offset().top;
        function onMouseMove(event) {
            container.css({
                left: event.pageX - shiftX + 'px',
                top: event.pageY - shiftY + 'px'
            })
        }
        function onMouseUp() {
            $(document).off('mousemove', onMouseMove);
            $(document).off('mouseup', onMouseUp);
        }
        $(document).on('mousemove', onMouseMove);
        $(document).on('mouseup', onMouseUp);
    })

    const hr = $("<hr>")
    container.append(hr)

    containerTextElement = $("<div></div>")
    containerTextElement.addClass('container-text')
    container.append(containerTextElement)
    addText("作者邮箱:baomidou_2024@qq.com")
    addText("自动打验证码可联系 QQ 3936884135")
    addText("脚本失效请先更新脚本,不会使用请复制下方链接在浏览器打开查看教程")
    addText("脚本安装教程文档:http://hg.3389.info/s/7yU8")
    addText("脚本安装与更新视频教程:http://hg.3389.info/s/Q0uy")
    addText("启动成功...")
    $("body").append(container)
}
const addStyle = () => {
    const style = $("<style></style>")
    style.prop('type', 'text/css')
    style.html(
        `
.popup {
    position: fixed;
    top: 50px;
    left: 150px;
    width: 520px;
    font: 14px Menlo, Monaco, Consolas, "Courier New", monospace;
    z-index: 9999999999999999999999;
    background-color: #fff;
    box-shadow: 0 0 5px 1px rgba(0, 0, 0, .3);
    padding: 10px;
    border-radius: 5px;
}
.popup h4{
    display: inline-block;
}
.popup b{
    color: red;
}

.container-header {
    height: 30px;
    cursor: move;
    line-height: 30px;
    color: blue;
}

.container-text {
    margin-top: 10px;
    max-height: 200px;
    min-height: 30px;
    overflow: auto;
}
        `
    )
    $('body').append(style);
}

const addText = text => {
    containerTextElement.append(text + "<br>")
    containerTextElement.scrollTop(containerTextElement[0].scrollHeight)
}
function pause(start, end = undefined) {
    let delay = start;
    if (end) {
        delay = Math.floor(Math.random() * (end - start)) + start;
        addText(`等待 ${delay} 秒后继续...`);
    }
    return new Promise(resolve => {
        setTimeout(() => {
            resolve();
        }, delay * 1000);
    });
}


const init = async () => {
    addContainer()
    addStyle()
    getCurrent()
    addText("初始化完成,可以解放双手了;为了更像人为点击,将会延时一段时间再播放<br>")
    await pause(3, 5)
}


(function () {
    'use strict';
    $(document).ready(async function () {
        await init()
        checkCaptchaTimer = setInterval(playVideo, 1000);
    });
})();