一个网站建设爱好者,技术交流,相互学习
当前位置:首页>>我的自考
某自考网课视频网站自动刷课油猴脚本
发布时间:2023-07-25 10:44:18 栏目:我的自考 阅读量:1122 作者:南方姑娘

某自考视频网站自动刷网课视频

// ==UserScript==
// @name         [new]刷课脚本2-自动播放未放完视频及下一集
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://cqlg.360xkw.com/gxplatform/gxlearningcenter/rebackVideo.html?subId=*
// @grant        none
// ==/UserScript==
//
(function() {
    'use strict';
    // Your code here...
    setTimeout(start, 5000);
    var ele;
    var index=0; // 当前视频
    function start(){
        ele = $('#recordVideoBox ul li').eq(index)
        console.log('======>',ele.find('span').text());
    }
    // 8、play:播放监听
    video.on('play', function (e) {
        console.log('提示该视频正在播放中')
        index = $('#recordVideoBox ul li .onLive').parent().index();
    })
    // 9、pause:暂停监听
    video.on('pause', function (e) {
        // 获取当前播放视频
        console.log("++++++++++++暂停监听++++++++++++")
        index = $('#recordVideoBox ul li .onLive').parent().index();
        var item_duration = parseInt(video[0].duration); // 当前视频总时长
        var watchTime = parseInt(studyprogress); // 观看时长
        console.log('视频总时长:',item_duration);
        console.log('视频已观看时长:',watchTime);
        // 判断当前视频是否看完
        if(watchTime < item_duration){
           var jb_onlive = $('#recordVideoBox ul li').find('.onLive')
           video[0].currentTime = watchTime;
           jb_onlive.click();
        }else{
           var jb_onlive2 = $('#recordVideoBox ul li').eq(++index).find('a')
           jb_onlive2.click();
        }
    })
})();


评论:

IT视频教程
Copyright © web小工匠 保留所有权利. 渝ICP备15008469号 网站地图