*最新版* 全国高校教师网络培训中心-自动刷课

适用于网址是 https://onlinenew.enetedu.com/ 的网站自动刷课,您需要手动打开课程播放页面,程序会监测视频是否暂停,自动点击播放,当前视频播放完成则自动播放下一个视频。

  1. // ==UserScript==
  2. // @name *最新版* 全国高校教师网络培训中心-自动刷课
  3. // @namespace https://onlinenew.enetedu.com/
  4. // @version 0.8
  5. // @description 适用于网址是 https://onlinenew.enetedu.com/ 的网站自动刷课,您需要手动打开课程播放页面,程序会监测视频是否暂停,自动点击播放,当前视频播放完成则自动播放下一个视频。
  6. // @author Praglody
  7. // @match https://onlinenew.enetedu.com/*/MyTrainCourse/ChoiceCourse*
  8. // @match https://onlinenew.enetedu.com/*/MyTrainCourse/OnlineCourse*
  9. // @grant none
  10. // @require https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. function randomNum(minNum, maxNum) {
  17. switch (arguments.length) {
  18. case 1:
  19. return parseInt(Math.random() * minNum + 1, 10);
  20. break;
  21. case 2:
  22. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  23. break;
  24. default:
  25. return 0;
  26. break;
  27. }
  28. }
  29. window.onload=function(){
  30. let pppplay = setInterval(function(){
  31. if($(".classcenter-chapter1 iframe").contents().find(".layui-layer-content iframe").length > 0){
  32. setTimeout(function(){
  33. $(".classcenter-chapter1 iframe").contents().find(".layui-layer-content iframe").contents().find("#questionid~div button").trigger("click")
  34. }, randomNum(15, 40) * 100);
  35. } else {
  36. $(".classcenter-chapter1 iframe").contents().find("video").trigger("play")
  37. }
  38. console.log(new Date().getTime(), $(".classcenter-chapter1 iframe").length, $(".classcenter-chapter1 iframe").contents().find(".layui-layer-content iframe").length)
  39. },5000);
  40. setTimeout(function(){
  41. $(".classcenter-chapter1 iframe").contents().find("video").on("timeupdate",function(){
  42. if(Math.ceil(this.currentTime) >= Math.ceil(this.duration)) {
  43. //clearInterval(pppplay);
  44. let flag = false;
  45. $(".classcenter-chapter2 ul li").each(function(t){
  46. console.log($(this).css("background-color") == "rgb(204, 197, 197)")
  47. if ($(this).css("background-color") != "rgb(204, 197, 197)") {
  48. if ($(this).find("span").text() != "[100%]") {
  49. flag = true;
  50. $(this).trigger("click");
  51. return false;
  52. }
  53. }
  54. });
  55. if(!flag) {
  56. clearInterval(pppplay);
  57. }
  58. }
  59. })
  60. },8000);
  61. }
  62. })();

QingJ © 2025

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