湖南青马刷视频刷题软件分享

一、软件介绍

1、主要由浏览器+插件的形式实现辅助看课答题

2、完全模拟人工操作,适用于湖南青马

3、青马网站进去会比较慢所以要有耐心。

二、主要功能

1、登录后自动多倍速播放青马课程视频

2、湖南青马刷视频,自动挂视频

3、打包好的脚本+浏览器,打开即用。

插件下载:https://wukongstudio.lanzoui.com/b01i8orji

湖南青马刷视频刷题软件分享

 

 

三、软件主要代码:

(function() {
    'use strict';
    let mode = '刷课'//'review'
    let speed = 2 //播放倍率
    let start_time = 0
    function auto_jump(){
        let video = document.getElementsByTagName('video')[0]
        video.onpause= function(){
            let jump = setInterval(function(){
                let con = document.querySelector(".u-btn.u-btn-default.cont.j-continue")
                if(con){con.click();clearInterval(jump)}
            },100)

            }
    }
    function FullScreen() {
        //全屏播放
        var ele = document.getElementsByTagName('video')[0]
        if (ele.requestFullscreen) {
            ele.requestFullscreen();
        } else if (ele.mozRequestFullScreen) {
            ele.mozRequestFullScreen();
        } else if (ele.webkitRequestFullScreen) {
            ele.webkitRequestFullScreen();
        }
    }
    function show(i){
        document.querySelector("#speedText").value= String(i.toFixed(1))
        GM_setValue('speed',i)
    }

    let main = ()=>{
        console.log('runmian')
        if (/content/.test(window.location.href)) {
            console.log('kaka_mooc_loaded');
            document.body.onkeydown = function(event) {//恢复按键屏蔽
                if (window.event) {
                    return event;
                }

            }
            //取消自动播放
            if(mode=='review'){
                let check = setInterval(function() {
                    let checkbox = document.querySelector("#courseLearn-inner-box > div > div > div.j-lscontent.lscontent > div.j-unitct.unitct > div.m-learnunitUI.f-pr.learn-plan-container > div.j-unitctBar.unitctBar.f-cb > div.f-fl > input")
                    if (checkbox) {
                        clearInterval(check)
                        checkbox.checked = false
                    }
                },
                                        100)
                }

            let pass = setInterval(function() {
                let video = document.getElementsByTagName('video')

                if (video.length > 0) {
                    clearInterval(pass)
                    auto_jump()
                    let has_value = GM_getValue('speed')
                    if(has_value){
                        speed = has_value
                    }
                    //if(GM_getValue('fullscreen')){//无效!!!!!!!!!!!!!!!!
                    //FullScreen()
                    // }
                    video[0].playbackRate = speed
                    video[0].currentTime = Number(GM_getValue('start_time')) ||0
                    video[0].play()
                    let start_time = GM_getValue('start_time') ||0
                    if(! document.querySelector("#startTime")){
                        let otest = document.querySelector("div.j-unitctBar.unitctBar.f-cb")
                        let nodestr = '</br><div><div><a id="PinP" class = "u-btn u-btn-default" align="left"><b>画中画播放</b></a></div>'+'<div><b>播放速度:</b><input type="text" id="speedText" style="border:black;outline: auto;padding-left: 3px;"></div><div>    <b>起始秒数:</b>    <input type="text" id="startTime" placeholder="'+start_time+'" style="border:black;outline: auto;padding-left: 3px;"></div>'
                        let newnode=document.createRange().createContextualFragment(nodestr);
                        otest.insertBefore(newnode,document.querySelector(".j-report-bug"))
                        document.querySelector("#PinP").onclick= function(){
                          //  video[0].requestPictureInPicture()
                            if (!document.pictureInPictureElement) {
                               video[0].requestPictureInPicture()
                                this.innerText = "恢复"
                            } else {
                                document.exitPictureInPicture()
                                this.innerText = "画中画播放"
                            }
                        }
                        document.querySelector("#speedText").onblur= function(){
                            document.getElementsByTagName('video')[0].playbackRate = parseFloat(document.querySelector("#speedText").value)
                            GM_setValue('is_focus',0)
                        }
                        document.querySelector("#speedText").onfocus= function(){
                            GM_setValue('is_focus',1)

                        }
                        document.querySelector("#startTime").onblur= function(){
                            GM_setValue('start_time',Number(document.querySelector("#startTime").value))
                            GM_setValue('is_focus',0)
                        }
                        document.querySelector("#startTime").onfocus= function(){
                            GM_setValue('is_focus',1)

                        }
                    }
                    show(document.getElementsByTagName('video')[0].playbackRate)
                    if(mode=='review'){
                        video[0].onended = function() { //自动播放下一p
                            if (document.querySelector(".f-fl.current").nextElementSibling == null) {
                                // 没了
                                let yid = /&id=(\d+)/.exec(window.location.href)[1]
                                let nid = parseInt(yid) + 1
                                window.location.href = window.location.href.replace(yid, String(nid))
                            } else {
                                //下1p
                                let ycid = /cid=(\d+)/.exec(window.location.href)[1]
                                let ncid = parseInt(ycid) + 1
                                window.location.href = window.location.href.replace(ycid, String(ncid))
                            }
                        }
                    }
                    document.body.onkeydown = function(ev) {

 

上一篇:JS 字符串 作为变量名


下一篇:selenium驱动chrome-等待等待下载完成后再下载下一个