学银在线助手/自动刷课

学银在线刷课,自动点击下一页

  1. // ==UserScript==
  2. // @name 学银在线助手/自动刷课
  3. // @namespace http://apcbat.top/
  4. // @version 1.4
  5. // @description 学银在线刷课,自动点击下一页
  6. // @author Apcbat
  7. // @match http://*.xueyinonline.com/mycourse/studentstudy?*
  8. // @grant none
  9. // @supportURL apcbat@qq.com
  10. // @contributionURL http://donate.apcbat.top/
  11. // @license Apache Licence 2.0
  12. // @icon http://donate.apcbat.top/xyzx/logo.ico
  13. // ==/UserScript==
  14. var t;
  15. var started=false;
  16. var button,btnDonate,divD,divTip,divPlay;
  17.  
  18. (function() {
  19. 'use strict';
  20.  
  21. var div= $("<div style='background-color:#FFF;position: fixed;left: 0;top: 50%;z-index: 99999;padding: 16px;transform: translateY(-50%);text-align: center;border-radius: 0 8px 8px 0;box-shadow: 0 0 4px #000000b3;box-sizing: border-box;'><strong>学银在线助手</strong><br><br></div>");
  22. button=$("<button style='border: none; background-color:#2196F3; color: #fff; padding: 8px; border-radius: 8px;width: 100px;'>点击开启</button>");
  23. button.click(function(){toggle();});
  24. btnDonate=$("<br><br><button style='border: none; background-color:#FF5722; color: #fff; padding: 8px; border-radius: 8px;width: 100px;'>捐  赠</button>");
  25.  
  26. divD=$("<div style='background-color:#FFF;display: none;position: fixed;top: 50%;left: 50%;padding: 16px; text-align: center;border-radius: 8px;transform: translate(-50%, -50%);box-shadow: 0 0 4px #000000b3;box-sizing: border-box;font-size:1.4em'>"+
  27. "<p><strong>感谢您的捐赠:)</strong></p><p><br><img src='http://donate.apcbat.top/AliPay.webp' width='200px' /> <img src='http://donate.apcbat.top/WeChat.webp' width='200px' /> </p>"+
  28. "<p><br><button style='border: none; background-color:#2196F3; color: #fff; padding: 8px; border-radius: 8px;width: 100px;z-index: 999999;'>关闭</button></p></div>");
  29. divPlay=$("<div style='background-color:#FFF;display: none;position: fixed;top: 50%;left: 50%;padding: 16px; text-align: center;border-radius: 8px;transform: translate(-50%, -50%);box-shadow: 0 0 4px #000000b3;box-sizing: border-box;'>"+
  30. "<strong>已自动播放!如需暂停请先点击右侧按钮暂停此插件:)</strong></div>")
  31. btnDonate.click(function(){
  32. divD.fadeIn();
  33. });
  34. divD.find("button").click(function(){closeDonate();});
  35. divTip=$("<div style='z-index:9999999;display: none;position: fixed;top: 0;width: 100%;text-align: center;color: #fff;line-height: 50px;background: #2196F3;'></div>");
  36.  
  37. div.append(button,btnDonate);
  38. $("body").append(div,divD,divTip,divPlay);
  39. })();
  40.  
  41. function toggle(){
  42. started=!started;
  43. if (started){
  44. button.text("点击暂停");
  45. tip("已开启,请不要离开此页面,否则上课时常可能不会被记录!",3000);
  46. tik();
  47. t = setInterval(function(){
  48. tik();
  49. }, 3000);
  50. }else {
  51. button.text("点击开启");
  52. tip("已关闭,感谢您的使用:)",2000);
  53. clearInterval(t);
  54. }
  55. }
  56.  
  57. function tip(msg,delay){
  58. divTip.text(msg);
  59. divTip.fadeIn();
  60. divTip.delay(delay).fadeOut();
  61. }
  62.  
  63. var first=true;
  64. function tik(){
  65. if(!started) return;
  66.  
  67. var ff=$("iframe").contents().find("iframe");
  68. var i;
  69. for(i=0;i<ff.length;i++){
  70. var f=isFinshed(ff[i],i);
  71. if(!f) break;
  72. }
  73. if(i==ff.length){
  74. tip("本节已完成:)",1500);
  75. first=true;
  76. $(".tabtags .orientationright").click();
  77. }else{
  78. var video=$(ff[i]).contents().find("video")[0];
  79. if(typeof(video) == "undefined") return;
  80. if(video.paused){
  81. log("paused");
  82. if(!first){
  83. divPlay.fadeIn();
  84. divPlay.delay(3000).fadeOut();
  85. }
  86. first=false;
  87. $(ff[i]).contents().find(".vjs-big-play-button").click();
  88. }
  89. }
  90. }
  91.  
  92. function isFinshed(frame,index){
  93. var fff=$(frame).contents();
  94.  
  95. var cur=fff.find(".vjs-current-time-display").text();
  96. var total=fff.find(".vjs-duration-display").text();
  97.  
  98. var ff = $("iframe").contents();
  99.  
  100. var finish=$(ff.find(".ans-attach-ct")[index]).hasClass("ans-job-finished");
  101.  
  102. if(cur=="0:00"&&finish) return true;
  103.  
  104. return finish&&cur==total;
  105. }
  106.  
  107. function log(msg){
  108. console.log(msg);
  109. }
  110.  
  111. function closeDonate(){
  112. divD.fadeOut();
  113. }
  114.  

QingJ © 2025

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