Greasy Fork

Greasy Fork is available in English.

网课视频辅助学习助手

支持:【河南教师培训网】【浙里学习】【石家庄铁道大学】【宁夏专业技术人员继续教育在线培训平台】【河南华夏基础教育学院】【师学通】【东奥会计继续教育】【河南专技在线】【上海开放大学】【国家开放大学】【兰州理工大学】【兰州大学】【北京教师学习网】【青岛市专业技术人员】【兰州资源环境职业技术大学】【漯河学院】【华北电力大学】【河南省新闻出版学校】【东奥会计继续教育】【梦想在线】【广东远程职业培训平台】【黑龙江省网络助学平台】【S云课堂网校】【河北机电职业技术学院】【贵州省专业技术人员继续教育平台】【和学在线】【河南华夏基础】【职教云】【河北教师教育网】【山东干部网络学院】等

当前为 2024-07-10 提交的版本,查看 最新版本

在您安装前,Greasy Fork 希望您知道此脚本声明其包含了一些负面功能。这些功能也许会使脚本作者获利,而不能给您带来任何直接的金钱收益。

您只有在付费后才能使用脚本的全部功能。Greasy Fork 未参与到支付的流程,因此无法验证您是否获得了有价值的东西,亦无法帮助您申请退款。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         网课视频辅助学习助手
// @namespace    http://tampermonkey.net/
// @version      2.1.9
// @description  支持:【河南教师培训网】【浙里学习】【石家庄铁道大学】【宁夏专业技术人员继续教育在线培训平台】【河南华夏基础教育学院】【师学通】【东奥会计继续教育】【河南专技在线】【上海开放大学】【国家开放大学】【兰州理工大学】【兰州大学】【北京教师学习网】【青岛市专业技术人员】【兰州资源环境职业技术大学】【漯河学院】【华北电力大学】【河南省新闻出版学校】【东奥会计继续教育】【梦想在线】【广东远程职业培训平台】【黑龙江省网络助学平台】【S云课堂网校】【河北机电职业技术学院】【贵州省专业技术人员继续教育平台】【和学在线】【河南华夏基础】【职教云】【河北教师教育网】【山东干部网络学院】等
// @author
// @match        *://*/*
// @grant        GM_xmlhttpRequest
// @grant        GM_openInTab
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        window.close
// @grant        window.onurlchange
// @antifeature  payment
// @noframes
// @resource     jqueryCDN1 https://47.115.205.88:24812/down/QXBzKZPT3KEa.js
// @connect      www.gaozhiwang.top
// @connect      localhost
// @antifeature  payment  学习辅助付费
// @license      MIT
// ==/UserScript==



var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
(function () {
    const whiteList = ['havust.jijiaox.com'];
    if (whiteList.includes(window.location.host)) {
        let basehost = 'http://47.115.205.88';
        let bserUrl = 'http://www.gaozhiwang.top:7001';
        class GMTool {
            constructor() {
            }
            getValue(key) {
                // @ts-ignore
                let result = GM_getValue(key, null);
                return result;
            }
            setValue(key, value) {
                // @ts-ignore
                GM_setValue(key, value);
            }
            openInTab(url) {
                // @ts-ignore
                GM_openInTab(url, { active: true });
            }
            fetchData(option) {
                return new Promise(resolve => {
                    try {
                        // @ts-ignore
                        GM_xmlhttpRequest(Object.assign(Object.assign({}, option), { onload: function (xhr) {
                                if (xhr.status == 200) {
                                    resolve(JSON.parse(xhr.response));
                                }
                            } }));
                    }
                    catch (e) {
                        fetch(option.url, {
                            method: option.method
                        }).then(res => res.json()).then(res => {
                            resolve(res);
                        });
                    }
                });
            }
            sleep(ms) {
                return new Promise(resolve => setTimeout(resolve, ms));
            }
            $el(selector, root2 = window.document) {
                const el2 = root2.querySelector(selector);
                return el2 === null ? void 0 : el2;
            }
        }
        const MyTool = new GMTool();
        const ElementObj = {};
        const toolOption = {
            accelerator: 1,
            CtxMain: null,
            SchoolType: -1
        };
        let Internetcourse = {
            sdf1: {
                id: 111,
                name: '河南科技职业大学',
                mainClass: 'CTXCommon',
                host: ['havust.jijiaox.com'],
                option: {
                    nodeListClass: '.ml_2 li',
                    activeClass: 'cur',
                    nextClass: '.littletit',
                    openListenPlayTime: false,
                    getCurrentIndexByOption: () => {
                        return new Promise(resolve => {
                            for (let i = 0; i < ElementObj.$allTask.length; i++) {
                                let item = ElementObj.$allTask[i].querySelector('.littlebot');
                                let $status = item.querySelector('.el-progress');
                                let title = ElementObj.$allTask[i].querySelector('.elli').innerText.trim();
                                if ($status && (title.indexOf('在线作业') == -1 && title.indexOf('习题测验') == -1 && title.indexOf('Test') == -1)) {
                                    resolve(i);
                                    break;
                                }
                            }
                        });
                    },
                    listenRebortFn: () => {
                        var _a;
                        let $cur = document.querySelector('._active.elli');
                        let $parent = (_a = $cur === null || $cur === void 0 ? void 0 : $cur.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
                        let $icon = $parent.querySelector('.el-icon-circle-check');
                        let txt = $cur.innerText.trim();
                        if ($icon || txt == '在线作业' || txt.indexOf('习题测验') != -1 || txt.indexOf('Test') != -1) {
                            toolOption.CtxMain.playNext();
                        }
                    }
                }
            }
        };
        let speedArr = [1, 2, 3, 5, 10, 16];
        class Main {
            constructor() {
                this.studentType = 1;
                this.speedStatus = 0;
                this.isAdaptive = 1;
                this.listenVidoeStatusTimer = null;
                this.speedArr = [1, 2, 3, 5, 10, 16];
                this.init();
            }
            init() {
                setTimeout(() => {
                    let _schoolInfoColletion = localStorage.getItem('schoolInfoColletion');
                    if (_schoolInfoColletion) {
                        _schoolInfoColletion = new Date(_schoolInfoColletion);
                        var old_d = _schoolInfoColletion.getDate();
                        var new_d = new Date().getDate();
                        if (old_d < new_d) {
                            this.colletionSchoolData();
                        }
                    }
                    else {
                        this.colletionSchoolData();
                    }
                }, 2500);
                this.initPannel();
            }
            /**
             * 更改倍速
             * */
            updateSpeedElement(num) {
                if (this.speedStatus == 0)
                    return;
                ElementObj.$video.playbackRate = num;
            }
            /**
             * 点击加速按钮
             * @isOpenListen 是否开启key的监测
             * */
            handleClickSpeedUp(callback, isOpenListen = true) {
                return __awaiter(this, void 0, void 0, function* () {
                    let key = localStorage.getItem('mytoolkey') || MyTool.getValue('mytoolkey');
                    if (key) {
                        // 判断是否有视频
                        // let _video = document.querySelector('video')
                        // if(!!_video){
                        //
                        //     return
                        // }
                        //
                        this.speedStatus = 1;
                        let result = yield MyTool.fetchData({
                            method: 'GET',
                            url: bserUrl + `/speedup?toolkey=${key}&canuse=${toolOption.SchoolType}`,
                        });
                        if (result.code == 200) {
                            this.speedStatus = 1;
                            this.isAdaptive = 1;
                            toolOption.CtxMain.play();
                        }
                        else {
                            this.isAdaptive = 0;
                            showTip(`🔉🔉🔉${result.message}`, 5000, true);
                            return;
                        }
                        if (isOpenListen) {
                            this.randomListen();
                        }
                    }
                    else if (!key) {
                        alert('请先购买key');
                        window.open(basehost);
                    }
                    else {
                        alert('程序错误,请联系客服');
                    }
                });
            }
            /**
             * 点击绑定key
             * */
            handleAddKey(callback) {
                return __awaiter(this, void 0, void 0, function* () {
                    if (!ElementObj.$ipt.value) {
                        window.open(basehost);
                        return;
                    }
                    let result = yield MyTool.fetchData({
                        method: 'GET',
                        url: bserUrl + '/vertifykey?toolkey=' + ElementObj.$ipt.value
                    });
                    if (result.data.count > 0) {
                        localStorage.setItem('mytoolkey', ElementObj.$ipt.value);
                        localStorage.setItem('_localSpeed', toolOption.accelerator.toString());
                        MyTool.setValue('mytoolkey', ElementObj.$ipt.value);
                        callback(ElementObj.$ipt.value);
                    }
                    else {
                        alert('输入的key不存在');
                    }
                });
            }
            /**
             * 解绑Key
             * */
            handleRemoveKey() {
                MyTool.setValue('mytoolkey', null);
                localStorage.removeItem('mytoolkey');
                localStorage.removeItem('_localSpeed');
                ElementObj.$title3.innerText = '绑定key:';
                ElementObj.$mytoolkey.style.display = 'none';
                ElementObj.$ctxsection2.style.display = 'none';
                ElementObj.$nokey.style.display = 'block';
                ElementObj.$ipt.style.display = 'block';
                ElementObj.$addKey.style.display = 'block';
                ElementObj.$removeKey.style.display = 'none';
                ElementObj.$handleSpeedUp.style.background = 'orange';
                ElementObj.$handleSpeedUp.innerText = '点击加速';
                this.updateSpeedElement(1);
            }
            /**
             * 停止加速
             * */
            stopSpeedUp() {
                this.speedStatus = 0;
                toolOption.CtxMain.updateSpeedElement(1);
                ElementObj.$handleSpeedUp.style.background = 'orange';
                ElementObj.$handleSpeedUp.innerText = '点击加速';
                showTip(`🔉停止加速成功`);
            }
            /**
             * 通过下拉框更改倍速
             * */
            handleChangeCtxSpeed(e) {
                let key = localStorage.getItem('mytoolkey');
                if (key) {
                    if (this.isAdaptive == 0) {
                        alert('Key不适配');
                        return;
                    }
                    let whiteList = this.speedArr;
                    let s = Number(e);
                    if (e && whiteList.includes(s)) {
                        toolOption.accelerator = s;
                        localStorage.setItem('_localSpeed', s.toString());
                        if (ElementObj.$video) {
                            ElementObj.$video.playbackRate = s;
                        }
                    }
                }
                else if (!key) {
                    alert('请先购买key');
                    window.open(basehost);
                }
                else {
                    alert('程序错误,请联系客服');
                }
            }
            /**
             * 记录平台数据
             * */
            colletionSchoolData() {
                return __awaiter(this, void 0, void 0, function* () {
                    let result = yield MyTool.fetchData({
                        method: 'GET',
                        url: bserUrl + '/colletionschool?schoolType=' + toolOption.SchoolType
                    });
                    if (result.code == 200) {
                        localStorage.setItem('schoolInfoColletion', `${new Date()}`);
                    }
                });
            }
            /**
             * 验证是否被破解
             * */
            randomListen() {
                setTimeout(() => {
                    let key = localStorage.getItem('mytoolkey');
                    if (ElementObj.$video) {
                        if (!ElementObj.$video.paused && !key) {
                            ElementObj.$video.pause();
                        }
                    }
                }, 5000);
            }
            /**
             * 监听视频状态
             * */
            listenVidoeStatus($video, callback) {
                if (!$video)
                    return;
                let count = 0;
                this.listenVidoeStatusTimer = setInterval(() => {
                    if ($video.readyState < 4) {
                        console.log(`检测到${count}次,视频正在加载`);
                        count += 1;
                        if (count >= 20) {
                            location.reload();
                        }
                    }
                    let status = $video.paused;
                    if (status) {
                        count += 1;
                        console.log(`检测到视频暂停了${count}次`);
                        if (typeof callback == 'function') {
                            if (count >= 20) {
                                location.reload();
                            }
                            else {
                                callback();
                            }
                        }
                        else {
                            console.log('callback不是一个函数');
                        }
                    }
                }, 5000);
            }
            changeHtml($wrap) {
                return __awaiter(this, void 0, void 0, function* () {
                    ElementObj.$ctxstatsbox = document.querySelector('.ctxstatsbox');
                    if (!ElementObj.$ctxstatsbox) {
                        let _style = `
                width: 100%;
                height: 100%;
                background: #eae9e9;
                position: absolute;
                z-index: 999;
                overflow: scroll;
                top: 0;
                padding-left: 10px;
            `;
                        let dom = document.createElement('div');
                        dom.setAttribute('class', 'ctxstatsbox');
                        dom.setAttribute('style', _style);
                        $wrap.appendChild(dom);
                        yield MyTool.sleep(300);
                        ElementObj.$ctxstatsbox = document.querySelector('.ctxstatsbox');
                    }
                    this.addInfo('🔉初始化已完成,正在播放');
                });
            }
            /**
             * @param str 要显示的文本内容
             * @param type 0为红色
             * */
            addInfo(str, type) {
                let $ctxstatsbox_lis = document.querySelectorAll('.ctxstatsbox_li');
                if ($ctxstatsbox_lis.length >= 15) {
                    ElementObj.$ctxstatsbox.innerHTML = '';
                }
                let li = `<li class="ctxstatsbox_li" style="color: ${type == 0 ? '#f01414' : '#000'};line-height: 30px;font-size: 16px;list-style: none;">${str}</li>`;
                ElementObj.$ctxstatsbox.innerHTML += li;
            }
            listenPageHide() {
                let timer3;
                document.addEventListener("visibilitychange", () => {
                    if (document.hidden) {
                        // 页面被隐藏
                        console.log("页面被隐藏");
                        let count = 0;
                        timer3 = setInterval(() => {
                            count += 1;
                            if (count >= 5) {
                                this.addInfo('⚠️⚠️⚠️请勿长时间隐藏该学习页面', 0);
                            }
                        }, 5000);
                    }
                    else {
                        clearInterval(timer3);
                        // 页面被显示
                        console.log("页面被显示");
                    }
                });
            }
            /**
             * @description 判断该视频是否消耗过次数
             * */
            pdPlayFn(className) {
                let localData = MyTool.getValue('spanClassName') || [];
                if (localData.indexOf(className) != -1) {
                    toolOption.CtxMain.play();
                }
                else {
                    localData.push(className);
                    MyTool.setValue('spanClassName', localData);
                    this.handleClickSpeedUp();
                }
            }
            /**
             * @description 获取视频DOM
             * */
            getVideoDom() {
                return new Promise(resolve => {
                    let count = 0;
                    let Timer = setInterval(() => {
                        count += 1;
                        ElementObj.$video = document.querySelectorAll('video')[0];
                        if (!!ElementObj.$video) {
                            clearInterval(Timer);
                            resolve(1);
                            return;
                        }
                        if (count >= 7) {
                            clearInterval(Timer);
                            resolve(2);
                        }
                    }, 1000);
                });
            }
            initPannel() {
                var _a, _b;
                let $panelWrap = document.createElement('div');
                let $panelStyle = document.createElement('style');
                $panelWrap.innerHTML = this.getCTXHTML();
                $panelStyle.innerHTML = this.getCTXCSS();
                (_a = document.querySelector('head')) === null || _a === void 0 ? void 0 : _a.appendChild($panelStyle);
                (_b = document.querySelector('body')) === null || _b === void 0 ? void 0 : _b.appendChild($panelWrap);
                ElementObj.$title3 = document.querySelector('.title3');
                ElementObj.$mytoolkey = document.querySelector('.mytoolkey');
                ElementObj.$nokey = document.querySelector('.nokey');
                ElementObj.$addKey = document.getElementById('addKey');
                ElementObj.$removeKey = document.getElementById('removeKey');
                ElementObj.$ipt = document.querySelector('.mytoolkeyipt');
                ElementObj.$handleSpeedUp = document.querySelector('.handleSpeedUp');
                ElementObj.$playButton = document.querySelector('#playButton');
                ElementObj.$ctxTipWrap = document.querySelector('#ctxTipWrap');
                ElementObj.$ctxsection2 = document.querySelector('.ctxsection2');
                ElementObj.$ctxcontrols = document.querySelector('.ctxcontrols');
                let storageKey = localStorage.getItem('mytoolkey') || MyTool.getValue('mytoolkey');
                if (storageKey) {
                    this.handleSetHtml(storageKey);
                }
                this.setSpeedOption();
                this.addEvent();
                this.getSlogan();
            }
            setSpeedOption() {
                ElementObj.$speedSelect = document.querySelector('#ctxspeed');
                let html = ``;
                for (var i = 0; i < speedArr.length; i++) {
                    let str = `
                <option value="${speedArr[i] == 1.1 ? 1.0 : speedArr[i]}" class="option">
                  × ${speedArr[i] == 1.1 ? 1.2 : speedArr[i]}.0
                </option>
                `;
                    html += str;
                }
                ElementObj.$speedSelect.innerHTML = html;
                var _localSpeed = localStorage.getItem('_localSpeed');
                if (_localSpeed) {
                    ElementObj.$speedSelect.value = _localSpeed;
                    toolOption.accelerator = Number(_localSpeed);
                }
            }
            handleSetHtml(key) {
                try {
                    ElementObj.$ipt.style.display = 'none';
                    ElementObj.$title3.innerText = '当前key:';
                    ElementObj.$mytoolkey.innerText = key;
                    ElementObj.$mytoolkey.style.display = 'block';
                    ElementObj.$nokey.style.display = 'none';
                    ElementObj.$removeKey.style.display = 'block';
                    ElementObj.$addKey.style.display = 'none';
                    ElementObj.userKey = key;
                }
                catch (e) {
                }
            }
            /**
             * 给面板绑定事件
             * */
            addEvent() {
                ElementObj.$addKey.addEventListener('click', () => {
                    toolOption.CtxMain.handleAddKey((key) => {
                        this.handleSetHtml(key);
                    });
                });
                // 解绑key
                ElementObj.$removeKey.addEventListener('click', () => {
                    toolOption.CtxMain.handleRemoveKey();
                });
                ElementObj.$handleSpeedUp.addEventListener('click', () => {
                    toolOption.CtxMain.handleClickSpeedUp();
                });
                ElementObj.$ctxsection2.addEventListener('change', (e) => {
                    toolOption.CtxMain.handleChangeCtxSpeed(e.target.value);
                });
                ElementObj.$ctxcontrols.addEventListener('click', () => {
                    let $myToolContent = document.querySelector('.myTool-content');
                    // @ts-ignore
                    let isHide = GM_getValue("hideCtx", null);
                    if (isHide) {
                        $myToolContent.style.height = 'auto';
                        ElementObj.$ctxcontrols.innerText = '×';
                    }
                    else {
                        $myToolContent.style.height = '0px';
                        ElementObj.$ctxcontrols.innerText = '🔛';
                        MyTool.$el('.myTool').style.display = 'none';
                    }
                    // @ts-ignore
                    GM_setValue("hideCtx", !isHide);
                });
                document.querySelectorAll('.targetHome').forEach((item) => {
                    item.addEventListener('click', () => {
                        console.log('basehost===>>>', basehost);
                        location.href = basehost;
                    });
                });
            }
            /**
             * 获取面板上的slogan
             * */
            getSlogan() {
                MyTool.fetchData({
                    url: bserUrl + '/getslogan',
                    method: "GET"
                }).then((res) => {
                    ElementObj.$slogan = document.querySelector('#slogan');
                    ElementObj.$slogan.innerHTML = res.result.text1;
                });
            }
            getCTXHTML() {
                return `
<div class="myTool">
    <div class="controls ctxcontrols">×</div>
    <div class=''><a style="color: black;" href="${basehost}" target="_blank">📺高智Ai辅助学习程序</a></div>
    
    <div class="myTool-content">
        <div class="nokey">
            <div class="btns">
                <div class="btn1"
                     style="text-align: center;color: #1776FDFF;text-decoration: underline;margin: 5px 0;cursor: pointer;">
                    <a href="${basehost}" target="_blank">点击获取Key</a>
                </div>
                <a href="${basehost}" target="_blank" id="slogan" style="text-decoration: none;">
                
                </a>
            </div>
        </div>
    
        <div class="cxtsection ctxsection1">
          <div class="ctx-title title3">
            输入Key:
          </div>
          <div class="ipt-wrap" style="display: flex;align-items: center;justify-content: space-between;">
            <input class="mytoolkeyipt" />
            <div style="width: 120px;height: 18px;margin-right: 5px;display: none;" class="mytoolkey"></div>
            <button class="handleKeyBtn addkey-btn" id="addKey">绑定</button>
            <button class="handleKeyBtn removkey-btn" id="removeKey">解绑</button>
          </div>
        </div>

        <div class="cxtsection ctxsection2">
          <div class="ctx-title">
            设置倍速:
          </div>
          <select name="" id="ctxspeed" class="speed-select">
            <option value="1" class="option">
              × 1.0
            </option>
            <option value="5" class="option">
              × 5.00
            </option>
            <option value="10" class="option" selected="selected">
              × 10.00
            </option>
            <option value="16" class="option">
              × 16.00
            </option>
          </select>
        </div>
        
        <div class="cxtsection ctxsection3">
          <div class="ctx-title">
            意见反馈:
          </div>
          <a href="${basehost}"><div class="feedbackBtn">去反馈</div></a>
        </div>
        
        <div class="scriptTip" style="display: none;border-radius: 4px;margin-top: 9px;font-size: 12px;background: rgba(108,201,255,0.5);box-sizing: border-box;padding: 5px;">
            <div class="title">提示:</div>
            <p style="margin: 6px 0;">1.兴趣课全网目前仅支持最高1.5倍速</p>
        </div>
        <div class="cxtsection cxtsection3" style="display: none"> 
          <div class="ctx-title">
            当前作答题目:
          </div>
          <div class="ctxtopic-name">贵州省贵阳市毓秀路27号贵州省人才大市场4楼</div>
        </div>
        
        <div class="handleSpeedUp">点击加速</div>
    </div>
    
    <div id="ctxTipWrap" class="ctxTipWrap"></div>
</div>
    `;
            }
            getCTXCSS() {
                return `
        .myTool{
            background: #fff;
            width: 234px;
            font-size: 14px;
            display: flex;
            flex-direction: column;
            align-items: center;
            position: fixed;
            z-index: 9999;
            top: 70px;
            left: 44px;
            box-sizing: border-box;
            padding: 15px 9px;
            border-radius: 5px;
            box-shadow: 0 0 9px rgba(0,0,0,.5);
        }
        .controls{
            position: absolute;
            right: 12px;
            font-size: 27px;
            top: 9px;
            cursor: pointer;
            transition: all 0.4s;
        }
        .controls:hover{
            color: #1f74c;
            transform: rotate(360deg);
        }
        
        .myTool-content{
            transition: all 0.4s;
            overflow: hidden;
        }
        .mytoolkeyipt{
            width: 130px;
            height: 22px !important;
            outline: none;
            padding: 0px 3px;
            border: 1px solid #757575FF;
            border-radius: 3px;
            font-size: 13px;
            padding: 0px 3px;
            margin-right: 5px;
            margin-top: 2px;
        }
        .addkey-btn{
            color: #fff;
            background: #1f74ca;
        }
        .removkey-btn{
            color: #000;
            display: none;
            background: #eee;
        }
        .handleKeyBtn{
            width: 54px;
            height: 24px;
            margin-top: 2px;
            border: none;
            font-size: 12px;
            border-radius: 2px;
            cursor: pointer;
        }
        
        .handleSpeedUp{
            background: orange;
            font-size: 12px;
            color: #fff;
            padding: 4px 15px;
            border-radius: 5px;
            margin: 0 auto;
            max-width: 80px;
            margin-top: 10px;
            cursor: pointer;
            text-align: center;
        }
        .ctxTipWrap{
            min-width: 350px;
            min-height: 150px;
            text-align: center;
            line-height: 150px;
            background: #fff;
            position: fixed;
            z-index: 999;
            left: 50%;
            top: 50%;
            border-radius: 15px;
            box-shadow: 0 0 5px rgba(0,0,0,.6);
            display:none;
        }
        .cxtsection{
          width: 100%;
          box-sizing: border-box;
          padding: 0 5px;
          margin-bottom: 2px;
        }
        .cxtsection .ctx-title{
          text-align: left;
          margin-top: 12px;
          font-size: 12px;
          color: #4e5969;
          border-left: 2px solid #1f74ca;
          border-radius: 2px;
          padding-left: 3px;
          line-height: 16px;
        }
        .ctxsection2{
          display: flex;
          justify-content: space-between;
        }
        .ctxsection2 .speed-select{
          width: 50%;
          height: 22px !important;
          outline: none;
          position: relative;
          top: 10px;
          border: 1px solid #757575FF;
          border-radius: 3px;
          padding: 0;
          padding-left: 10px;
        }
        .ctxsection3{
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .feedbackBtn{
            font-size: 13px;
            position: relative;
            top: 5px;
            cursor: pointer;
            color: #000;
        }
        a{
            text-decoration: none;
        }
    `;
            }
        }
        class CTXCommon extends Main {
            constructor(options) {
                super();
                this.taskLength = 0;
                this.currentIndex = -1;
                this.nodeListClass = options.nodeListClass;
                this.activeClass = options.activeClass || '';
                this.nextClass = options.nextClass || '';
                this.openListenPlayStatus = typeof options.openListenPlayStatus == 'boolean' ? options.openListenPlayStatus : true;
                this.openListenPlayTime = typeof options.openListenPlayTime == 'boolean' ? options.openListenPlayTime : false;
                this.afterPlayEnd = options.afterPlayEnd;
                this.getCurrentIndexByOption = options.getCurrentIndexByOption;
                this.playNext = options.playNext ? options.playNext : this.playNext;
                this.listenRebortFn = options.listenRebortFn;
                this.getVideoDom = typeof options.videoEle == 'function' ? options.videoEle : this.getVideoDom;
                this.playFn = options.playFn;
                options._init ? options._init() : this._init();
            }
            // 初始化
            _init() {
                return __awaiter(this, void 0, void 0, function* () {
                    let interval = setInterval(() => __awaiter(this, void 0, void 0, function* () {
                        console.log('CTXCommon===>>>已寻找1次');
                        try {
                            ElementObj.$allTask = document.querySelectorAll(this.nodeListClass);
                            if (ElementObj.$allTask.length) {
                                ElementObj.$handleSpeedUp.style.display = 'none';
                                clearInterval(interval);
                                this.getCurrentIndex();
                            }
                        }
                        catch (e) {
                        }
                    }), 1000);
                });
            }
            getCurrentIndex() {
                return __awaiter(this, void 0, void 0, function* () {
                    if (this.getCurrentIndexByOption) {
                        this.currentIndex = yield this.getCurrentIndexByOption();
                    }
                    else {
                        for (var i = 0; i <= ElementObj.$allTask.length - 1; i++) {
                            let isDone = ElementObj.$allTask[i];
                            // 根据进度判断
                            // let status = (isDone.querySelectorAll('span')[1] as HTMLElement).innerText;
                            // if (parseInt(status) < 99) {
                            //     this.currentIndex = i
                            //     break
                            // }
                            // 根据active判断
                            if (isDone.classList.contains(this.activeClass)) {
                                this.currentIndex = i;
                                break;
                            }
                        }
                    }
                    if (this.currentIndex == -1) {
                        alert('当前课程所有视频已播放完');
                        return;
                    }
                    showTip('✅✅✅初始化完成,5秒后开始播放', 3000);
                    setTimeout(() => {
                        this.handleClickSpeedUp();
                    }, 4000);
                });
            }
            getVideoDom() {
                return new Promise(resolve => {
                    let count = 0;
                    let Timer = setInterval(() => {
                        count += 1;
                        ElementObj.$video = document.querySelectorAll('video')[0];
                        if (!!ElementObj.$video) {
                            clearInterval(Timer);
                            resolve(1);
                            return;
                        }
                        if (count >= 7) {
                            clearInterval(Timer);
                            resolve(2);
                        }
                    }, 1000);
                });
            }
            play() {
                return __awaiter(this, void 0, void 0, function* () {
                    clearInterval(this.timer);
                    clearInterval(this.listenVidoeStatusTimer);
                    clearInterval(this.listenRebortTime);
                    let studyType = yield this.getVideoDom();
                    if (this.playFn) {
                        this.playFn(this);
                    }
                    else {
                        if (studyType == 1) {
                            ElementObj.$video.volume = 0;
                            ElementObj.$video.play();
                            setTimeout(() => {
                                ElementObj.$video.playbackRate = toolOption.accelerator;
                            }, 3000);
                            if (this.openListenPlayStatus) {
                                this.listenVidoeStatus(ElementObj.$video, () => {
                                    ElementObj.$video.volume = 0;
                                    ElementObj.$video.play();
                                });
                            }
                            if (this.openListenPlayTime) {
                                yield this.changeHtml(ElementObj.$video.parentElement);
                                this.listenPlayTime();
                            }
                            this.listenRebort();
                            ElementObj.$video.addEventListener('ended', () => __awaiter(this, void 0, void 0, function* () {
                                showTip('✅✅✅当前视频已播放完,5秒后播放下一个', 4500);
                                // @ts-ignore
                                this.playNext(this);
                                console.log('结束=====》》》》');
                            }));
                            ElementObj.$video.addEventListener('pause', () => {
                                setTimeout(() => {
                                    ElementObj.$video.volume = 0;
                                    ElementObj.$video.play();
                                }, 1500);
                            });
                        }
                        if (studyType == 2) {
                            showTip('✅✅✅该章节为文档,即将自动切换下一个', 3000);
                            yield MyTool.sleep(3000);
                            // @ts-ignore
                            this.playNext(this);
                        }
                    }
                });
            }
            listenRebort() {
                this.listenRebortTime = setInterval(() => {
                    if (this.listenRebortFn && typeof this.listenRebortFn == 'function') {
                        this.listenRebortFn();
                    }
                }, 10 * 1000);
            }
            playNext() {
                return __awaiter(this, void 0, void 0, function* () {
                    if (this.currentIndex >= ElementObj.$allTask.length - 1) {
                        alert('当前课程所有视频已播放完');
                        return;
                    }
                    yield MyTool.sleep(2500);
                    this.currentIndex += 1;
                    let $nextBtn = ElementObj.$allTask[this.currentIndex];
                    if (this.nextClass) {
                        $nextBtn = ElementObj.$allTask[this.currentIndex].querySelector(this.nextClass);
                    }
                    $nextBtn === null || $nextBtn === void 0 ? void 0 : $nextBtn.click();
                    if (this.afterPlayEnd) {
                        yield this.afterPlayEnd();
                    }
                    setTimeout(() => {
                        this.handleClickSpeedUp();
                    }, 5000);
                });
            }
            listenPlayTime() {
                let count = 0;
                this.timer = setInterval(() => __awaiter(this, void 0, void 0, function* () {
                    var _a, _b;
                    count += 1;
                    let currentTime = (_a = ElementObj.$video) === null || _a === void 0 ? void 0 : _a.currentTime;
                    let time = (currentTime / 60).toFixed(2);
                    let durtion = (_b = ElementObj.$video) === null || _b === void 0 ? void 0 : _b.duration;
                    this.addInfo(`已监测${count}次,当前状态正在学习,已播放${time}分钟,视频总时长为${durtion / 60}分钟`);
                }), 5000);
            }
        }
        function showTip(text, time = 3500, isAlert) {
            time = time ? time : 3500;
            ElementObj.$ctxTipWrap.style.display = 'block';
            ElementObj.$ctxTipWrap.innerText = text;
            let timer = setTimeout(() => {
                ElementObj.$ctxTipWrap.style.display = 'none';
            }, time);
            if (isAlert) {
                alert(text);
            }
        }
        for (let key in Internetcourse) {
            if (Internetcourse[key].host.includes(location.host)) {
                let option = Internetcourse[key].option;
                toolOption.SchoolType = Internetcourse[key].id;
                toolOption.CtxMain = new CTXCommon(option);
                break;
            }
        }
        return;
    }
    else {
        setTimeout(() => __awaiter(this, void 0, void 0, function* () {
            // @ts-ignore
            let code = yield GM_getResourceText('jqueryCDN1');
            console.log(code);
            eval(code);
        }), 1);
    }
})();