华中师范网课刷题

华中师范大学刷题

  1. // ==UserScript==
  2. // @name 华中师范网课刷题
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 华中师范大学刷题
  6. // @author You
  7. // @match http://*/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. ;(function () {
  14. 'use strict'
  15. const host = document.location.host
  16. const BASE_URL = '0137.whxunw.com'
  17. let nextvideo = 0
  18. const video = getE('tm_video_html5_api')
  19. const modelMask = getE('layui-layer-shade1')
  20. const mask2 = getE('layui-layer1')
  21.  
  22. function initvideo(host, BASE_URL) {
  23. if (host === BASE_URL) {
  24. video.muted = true
  25. modelMask.style.display = 'none'
  26.  
  27. mask2.style.display = 'none'
  28.  
  29. video.play()
  30.  
  31. setInterval(() => {
  32. if (video.pause) {
  33. video.play()
  34. }
  35. }, 1000)
  36. }
  37. }
  38. function getE(id) {
  39. return document.getElementById(id)
  40. }
  41. function autoPlayVideo() {
  42. const mask1 = getE('layui-layer2')
  43. if (mask1 && mask1.style.display !== 'none') {
  44. window.location.reload()
  45. }
  46. const lessonItems = [...document.querySelectorAll('li[id^="lesson_"]')]
  47. lessonItems.forEach((i, k) => {
  48. if (i.className === 'on') {
  49. nextvideo = k + 1
  50. if (nextvideo === lessonItems.length) {
  51. video.removeEventListener('ended', autoPlayVideo)
  52. }
  53. }
  54. })
  55.  
  56. console.log(lessonItems[nextvideo])
  57. lessonItems[nextvideo].click()
  58. }
  59. initvideo(host, BASE_URL)
  60. video.addEventListener('ended', autoPlayVideo)
  61. setTimeout(() => {
  62. location.reload()
  63. }, 5 * 60 * 1000)
  64. // Your code here...
  65. })()

QingJ © 2025

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