🥇【安徽继续教育在线刷课】影刃平台

安徽继续教育在线刷课

  1. // ==UserScript==
  2. // @name 🥇【安徽继续教育在线刷课】影刃平台
  3. // @namespace https://doc.yingren.xyz/
  4. // @version 0.1
  5. // @description 安徽继续教育在线刷课
  6. // @author 影刃
  7. // @match *://main.ahjxjy.cn/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @license GPL 3
  11. // ==/UserScript==
  12. (function () {
  13. 'use strict';
  14. var Video;
  15. var NextClassButton;
  16. var Interval;
  17. function findVideo() {
  18. var obj = document.getElementsByClassName("jw-video jw-reset");
  19. if (obj.length == 0) {
  20. console.log("未找到视频播放器");
  21. } else {
  22. Video = obj[0];
  23. clearInterval(Interval);
  24. console.log("视频播放器已找到");
  25. playVideo();
  26. }
  27. }
  28. function findNextClassButton() {
  29. var obj = document.getElementsByClassName("btn btn-green");
  30. if (obj.length == 0) {
  31. console.log("未找到下一节按钮");
  32. } else {
  33. NextClassButton = obj[0];
  34. console.log("下一节按钮已找到");
  35. NextClassButton.click();
  36. relaod();
  37. }
  38. }
  39. function listenNextVideo() {
  40. Video.currentTime = Video.duration;
  41. Video.addEventListener("ended", function () {
  42. findNextClassButton();
  43. });
  44. }
  45. function playVideo() {
  46. try {
  47. Video.muted = true
  48. var playPromise = Video.play();
  49. if (playPromise !== undefined) {
  50. playPromise.then(_ => {
  51. listenNextVideo();
  52. }).catch(error => {
  53. console.log(error);
  54. if (error.message.match(/interact/) != null) {
  55. alert("浏览器已禁止自动播放,请手动点击播放后自动刷课");
  56. } else {
  57. alert("未知错误,请手动点击播放后自动刷课");
  58. }
  59. Video.addEventListener("play", function () {
  60. listenNextVideo();
  61. });
  62. });
  63. }
  64. } catch (e) {
  65. console.log(e);
  66. }
  67. }
  68. function relaod() {
  69. Video = null;
  70. NextClassButton = null;
  71. Interval = null;
  72. main();
  73. }
  74. function main() {
  75. Interval = setInterval(function () {
  76. findVideo();
  77. }, 100);
  78. }
  79. main();
  80. })();

QingJ © 2025

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