河师大刷课脚本

河南师范大学 继续教育学院 自动刷课工具

  1. // ==UserScript==
  2. // @name 河师大刷课脚本
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.0
  5. // @description 河南师范大学 继续教育学院 自动刷课工具
  6. // @author Miaory
  7. // @match https://cj1027-kfkc.webtrn.cn/*
  8. // @icon http://webtrn.cn/favicon.ico
  9. // @grant none
  10. // @license GPL
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. if(window.location.pathname == '/learnspace/learn/learn/templateeight/index.action'){
  17. console.log('进入课程详情');
  18.  
  19. //弹窗点击
  20. setInterval(function(){
  21. if($('.layui-layer-btn0').length>0){
  22. $('.layui-layer-btn0').click();
  23. }
  24. },1000);
  25.  
  26. //是否播放页面
  27. setInterval(function(){
  28. var text = $('.s_mainmenucurrent').text();
  29. if(text != '课件'){
  30. $('#courseware_main_menu div').click();
  31. }
  32. },5000);
  33.  
  34. }
  35.  
  36. if(window.location.pathname == '/learnspace/learn/learn/templateeight/courseware_index.action'){
  37. console.log('进入视频播放');
  38.  
  39. window.isEnd = false;
  40. //播放完成,点击下一节
  41. setInterval(function(){
  42. console.log(isEnd);
  43. if(isEnd == true){
  44. isEnd = false;
  45. var len = $('.s_point').length;
  46. for(var i=0;i<len;i++){
  47. if($('.s_point').eq(i).hasClass('s_pointerct') == false && $('.s_point').eq(i).attr('completestate') == 0){
  48. $('.s_point').eq(i).parent().show();
  49. $('.s_point').eq(i).click();
  50. console.log('播放下一节');
  51. break;
  52. }
  53. }
  54. }
  55. },3000);
  56. }
  57.  
  58. if(window.location.pathname == '/learnspace/learn/learn/templateeight/content_video.action'){
  59. console.log('播放内容页');
  60.  
  61. //视频暂停点击
  62. setInterval(function(){
  63. if($('.prism-play-btn.playing').length == 0){
  64. $('.prism-play-btn').click();
  65. }
  66. },1000);
  67. setInterval(function(){
  68. if($('#container_display_button').css('opacity') == 1){
  69. $('#container_display_button').click();
  70. }
  71. },1000);
  72.  
  73. //播放完成检测
  74. setInterval(function(){
  75. var now = time_to_sec($('#screen_player_time_1').text());
  76. var total = time_to_sec($('#screen_player_time_2').text());
  77. if(now >0 && total > 0 && (now / total)>0.95){
  78. window.parent.isEnd = true;
  79. }
  80. },500);
  81. setInterval(function(){
  82. var now = time_to_sec($('#container_controlbar_elapsed').text());
  83. var total = time_to_sec($('#container_controlbar_duration').text());
  84. if(now >0 && total > 0 && (now / total)>0.95){
  85. window.parent.isEnd = true;
  86. }
  87. },500);
  88.  
  89. }
  90.  
  91. function time_to_sec(time) {
  92. var s = '';
  93. var hour = 0;
  94. var min = 0;
  95. var sec= 0;
  96. if(time.split(':').length == 1){
  97. sec = time.split(':')[0];
  98. }
  99. if(time.split(':').length == 2){
  100. min = time.split(':')[0];
  101. sec = time.split(':')[1];
  102. }
  103. if(time.split(':').length == 3){
  104. hour = time.split(':')[0];
  105. min = time.split(':')[1];
  106. sec = time.split(':')[2];
  107. }
  108.  
  109. s = Number(hour*3600) + Number(min*60) + Number(sec);
  110.  
  111. return s;
  112. };
  113. })();

QingJ © 2025

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