🥇【华医网助手】huayiwang_完全免费_无人值守_自动播放|另有代挂_全自动_安全可靠_过人脸_全网最低价

huayiwang, 华医网,自动播放,自动静音,屏蔽答题,调整视频质量为最低,当前视频播放结束自动进入下一个视频,播放结束清理无用定时器

  1. // ==UserScript==
  2. // @name 🥇【华医网助手】huayiwang_完全免费_无人值守_自动播放|另有代挂_全自动_安全可靠_过人脸_全网最低价
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.6.5
  5. // @description huayiwang, 华医网,自动播放,自动静音,屏蔽答题,调整视频质量为最低,当前视频播放结束自动进入下一个视频,播放结束清理无用定时器
  6. // @author 华医网助手
  7. // @license AGPL License
  8. // @match *://*.91huayi.com/course_ware/course_ware_polyv.aspx?*
  9. // @match *://*.91huayi.com/pages/exam.aspx?*
  10. // @match *://*.91huayi.com/pages/exam_result.aspx?*
  11. // @match *//*.wsglw.net/train/courseware/cc?*
  12. // @match *://*.91huayi.com/*
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. (() => {
  17. // 非播放界面直接返回
  18. var urlInfos = window.location.href.split("/");
  19. var urlTip = urlInfos[urlInfos.length - 1].split("?")[0];
  20. if (urlTip != "course_ware_polyv.aspx") {
  21. return
  22. }
  23. addInfo();
  24. killQuestion();
  25. examherftest();
  26. let video = document.querySelector('video');
  27. window.examInterval = setInterval(() => {
  28. examherftest()
  29. }, 1000);
  30. window.playInterval = setInterval(() => {
  31. if (video.paused) {
  32. video.play();
  33. }
  34. if (window.player && window.player.getCurrentLevel() != 1) {
  35. window.player.changeLevel(1)
  36. }
  37. video.volume = 0;
  38. video.muted = true;
  39. }, 1000);
  40.  
  41. function examherftest() { //考试按钮激活状态检测
  42. var hreftest = document.getElementById("jrks").attributes["href"].value;
  43. if (hreftest != "#") { //考试按钮已激活
  44. //自动播放下一个视频的
  45. const targetElements = document.querySelectorAll("i[id='top_play']");
  46. const parentElement = targetElements[0].parentElement;
  47. const grandparentElement = parentElement.parentElement;
  48.  
  49. const lis = document.querySelectorAll("li[class='lis-inside-content']");
  50. var index = Array.from(lis).findIndex(li => li === grandparentElement);//找出当前页面是第几个课程
  51. //console.log(index);
  52. if (index + 2 <= document.querySelectorAll("li[class='lis-inside-content']").length) {
  53. index += 2;
  54. //console.log("新的Index:" + index);
  55. document.querySelector("#top_body > div.video-container > div.page-container > div.page-content > ul > li:nth-child(" + index + ") > h2").click();
  56. setTimeout(function () {
  57. document.evaluate("//button[contains(., '知道了')]", document, null, XPathResult.ANY_TYPE).iterateNext().click();
  58. }, 2000);
  59. } else {
  60. if ($('button:contains("未学习")').length > 0) {
  61. $('button:contains("未学习")').siblings().eq(0).click();
  62. } else if ($('button:contains("学习中")').length > 0) {
  63. $('button:contains("学习中")').siblings().eq(0).click();
  64. } else if ($('button:contains("待考试")').length > 0 && document.querySelector("a[id='mode']").innerText.indexOf("视频+考试") != -1) {
  65. $('button:contains("待考试")').siblings().eq(0).click();
  66. } else {
  67. console.log('没有找到任何按钮');
  68. clearInterval(examInterval);
  69. };
  70. };
  71. };
  72. };
  73.  
  74. function killQuestion() {
  75. (async function () {
  76. while (!window.player || !window.player.sendQuestion) {
  77. await sleep(20);
  78. };
  79. //console.log("课堂问答跳过插入");
  80. window.player.sendQuestion = function () {
  81. //console.log("播放器尝试弹出课堂问答,已屏蔽。");
  82. };
  83. })();
  84. window.killQuestionInterval = setInterval(async function () {
  85. try {
  86. if ($('.pv-ask-head').length && $('.pv-ask-head').length > 0) {
  87. console.log("检测到问题对话框,尝试跳过");
  88. $(".pv-ask-skip").click();
  89. };
  90. } catch (err) {
  91. console.log(err);
  92. };
  93. try {
  94. if ($('.signBtn').length && $('.signBtn').length > 0) {
  95. console.log("检测到签到对话框,尝试跳过");
  96. $(".signBtn").click();
  97. };
  98. } catch (err) {
  99. console.log(err);
  100. };
  101. try {
  102. if ($("button[onclick='closeProcessbarTip()']").length && $("button[onclick='closeProcessbarTip()']").length > 0 && $("div[id='div_processbar_tip']").css("display") == "block") {
  103. console.log("检测到温馨提示对话框(不能拖拽),尝试跳过");//
  104. //$("button[onclick='closeBangZhu()']").click();
  105. $("button[onclick='closeProcessbarTip()']").click();
  106. };
  107. } catch (err) {
  108. console.log(err);
  109. };
  110. try {
  111. if ($("button[class='btn_sign']").length && $("button[class='btn_sign']").length > 0) {
  112. console.log("检测到温馨提示对话框(疲劳提醒),尝试跳过");
  113. $("button[class='btn_sign']").click();
  114. };
  115. } catch (err) {
  116. console.log(err);
  117. };
  118. try {
  119. if ($("#floatTips") && $("#floatTips").is(":visible")) {
  120. console.log("检测到二维码,尝试跳过");
  121. window.closeFloatTips();
  122. };
  123. } catch (err) {
  124. console.log(err);
  125. };
  126. try {
  127. var state = document.querySelectorAll("i[id='top_play']")[0].parentNode.nextElementSibling.nextElementSibling.nextElementSibling.innerText;
  128. if ($('video').prop('paused') == true && state != "已完成") {
  129. console.log("视频意外暂停,恢复播放");
  130. $('video').get(0).play();
  131. $('video').prop('volumed') = 0;
  132. $('video').prop('muted') = true;
  133. } else if (state == "已完成") {
  134. document.querySelector("video").pause();
  135. //clearInterval(clockms);
  136. };
  137. } catch (err) {
  138. //console.log(err);
  139. };
  140. }, 2000);
  141. };
  142.  
  143. function addInfo() {
  144. let tip = document.createElement('p');
  145. tip.style.fontSize = '50px';
  146. tip.style.color = 'red';
  147. tip.style.textAlign = 'center';
  148. tip.textContent = '有合作需求可加v: idpx1995';
  149. document.body.appendChild(tip);
  150. };
  151. })()