党课脚本

try to take over the world!

目前為 2020-06-25 提交的版本,檢視 最新版本

// ==UserScript==
// @name         党课脚本
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://dxpx.ahstu.edu.cn/jjfz/lesson/play*
// @grant        none
// @require      https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';

    layui.use("layer", function () {
        var layer = layui.layer;

        layer.load(2, {shade: [0.5, 'grey']});

        players[0].on('loadedmetadata', function (event) {
            layer.closeAll('loading');

            if ("" != "") {
                var r_time = parseInt();

                hour = 0, minute = 0, second = 0; //时间默认值
                hour = Math.floor(r_time / 60 / 60) < 10 ? '0' + Math.floor(r_time / 60 / 60) : Math.floor(r_time / 60 / 60);
                minute = Math.floor(r_time / 60 % 60) < 10 ? '0' + Math.floor(r_time / 60 % 60) : Math.floor(r_time / 60 % 60);
                second = Math.floor(r_time % 60) < 10 ? '0' + Math.floor(r_time % 60) : Math.floor(r_time % 60);
                last_time = hour + ":" + minute + ":" + second;

               // $(".public_cancel").click();
                //$(".public_close").click();
                players[0].forward(parseInt());
                players[0].play();
            } else {
                    //$(".public_close").click();
                    players[0].play();
            }
            $(".public_cont").css("left", "40%");
        });
    });



      setTimeout(()=>{
       $(".public_cancel").click();
       $(".public_close").click();
       players[0].forward(parseInt());
       players[0].play();
       console.log(222)
       window.CheckPageFocus = () => {
       }
      }, 1000);

       players[0].on('ended', function (event) {
      if ("1" == "1") {
          window.clearTimeout(long_timer);   //定时器清除;
          window.clearInterval(flag);   //定时器清除;
      }
      let href_list = [];
            $('li a').each(function(){
              var href = $(this).attr('href');
              href_list.push(href);
            });
            let loc = location.pathname + location.search;
            let index = href_list.indexOf(loc);

      $.ajax({
          type: "POST",
          cache: false,
          dataType: "json",
          url: "/jjfz/lesson/resource_record",
          data: {
              rid: "7062",
              resource_id: "10302",
              video_id: "4692",
              lesson_id: "477",
              _xsrf: $(":input[name='_xsrf']").val()
          },
          success: function (data) {
            window.clearTimeout(long_timer);

            if (index < href_list.length - 1) {
              window.location.href = href_list[index + 1];
            }
            else {
              alert('已经全部播放完毕了呦')
            }
          }
      });
    });

      players[0].on('pause', (event)=> {
      setTimeout(()=> {
      players[0].play();
      players[0].forward(parseInt());
      console.log('play')
      }, 1000);
    })
    setTimeout(()=>{
      document.hasFocus = ()=> { return true};
      window.loop_pause = () => {console.log('拦截成功')};
      console.log(111);
    }, 3000)
    // Your code here...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址