河南教师培训网

1.视频可以多开
2.配合定时器解决不定时回答问题

点击查看代码
// ==UserScript==
// @name         河南教师培训网
// @namespace    http://tampermonkey.net/
// @version      2024-12-14
// @description  try to take over the world!
// @author       You
// @match        https://www.teachersedu.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=teachersedu.cn
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
let curVideoSrc = ''
setVideo()
function setVideo () {
    let video = document.querySelector('video')
    if (video && video.src !== curVideoSrc) {
        curVideoSrc = video.src
        video.addEventListener('ended', function () {
            let div_current = document.querySelector('.task-item.active')
            let next = div_current.parentNode.parentNode.parentNode.nextElementSibling
            next.querySelector('a').click()
        })
    }
}

setInterval(() => {
  let button = document.querySelector('.alert-box-btns .confirm-btn')
  if (button && button.innerText === '下一节') {
      button.click()
  }
  setVideo()
}, 3000)
})();

控制台下面

点击查看代码
setInterval(function () {

    let video = document.querySelector('video')
    if (video.paused) {
        video.play()
    }
}, 1000)
posted @ 2024-12-14 19:12  神仙不在  阅读(65)  评论(0)    收藏  举报