🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

【万能视频自动刷课时播放加速答题考试脚本】各类专业技术人员,教师,会计,医学继续教育公需课专业课·····

【弘成教育学起plus】【国开在线】【各类继续教育】【各类教师培训】【各类会计】【Q2444349169】。

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         【万能视频自动刷课时播放加速答题考试脚本】各类专业技术人员,教师,会计,医学继续教育公需课专业课·····
// @version      1.0
// @description  【弘成教育学起plus】【国开在线】【各类继续教育】【各类教师培训】【各类会计】【Q2444349169】。
// @author       万能脚本
// @match        http://www.gzjxjy.gzsrs.cn/*/*
// @license      MIT
// @namespace https://greasyfork.org/users/1030542
// ==/UserScript==

const page = (pathname) => {
  return new Promise(resolve => {
    const timer = setInterval(() => {
      if (pathname[0] === '/') {
        if (location.href.includes(pathname)) {
          clearInterval(timer)
          resolve()
        }
      } else {
        if (location.href.includes(pathname)) {
          clearInterval(timer)
          resolve()
        }
      }
    }, 300)
  })
}
 
document.querySelector('video').defaultPlaybackRate = 3.0;//设置默认三倍速播放

document.querySelector('video').play();

const getElement = (selector) => {
  return new Promise(resolve => {
    const timer = setInterval(() => {
      const element = typeof selector === 'string' ? document.querySelector(selector) : selector
 
      if (element) {
        clearInterval(timer)
        resolve(element)
      }
    }, 60)
  })
}
 
page('/personback/#/learning').then(() => {
  getElement('video').then(video => {
    video.muted = true
  
    const playList = Array.from(document.querySelectorAll('.el-steps .el-step .title-step'))
    let currentIndex = 0
  
    const nextVideo = () => {
      let currentNow = Date.now()
  
      const timer = setInterval(async () => {
        if (isNaN(video.duration)) {
          video = await getElement('video')
          video.muted = true
        }
  
        if (Date.now() - currentNow < 15000) {
          if (video.paused) {
            video.play()
          }
  
          return
        }
  
        if (video.currentTime >= (video.duration - 1) && video.paused) {
          currentIndex += 1
  
          if (currentIndex >= playList.length) {
            currentIndex = 0
          }
    
          playList[currentIndex].click()
    
          clearInterval(timer)
  
          setTimeout(() => {
            nextVideo()
          }, 1000)
        }
      }, 1000)
    }
 
    setInterval(() => {
      const button = document.querySelector('.el-dialog__wrapper .el-button span')
 
      if (button) {
        button.click()
      }
    }, 1000)
  
    nextVideo()
  })
})