师加网多主题自动切换/课程自动播放

师加网,多主题课程自动切换播放!自动判断未完成课程!

目前为 2022-01-11 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 师加网多主题自动切换/课程自动播放
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description 师加网,多主题课程自动切换播放!自动判断未完成课程!
  6. // @author JCB
  7. // @match http://nlts.teacherplus.cn/project/course/*
  8. // @match http://nlts.teacherplus.cn/learning/course/*
  9. // @match http://nlts.teacherplus.cn/learning/task*
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. var currenthref=location.href;
  17. //1.主题切换
  18. if(currenthref && currenthref.startsWith("http://nlts.teacherplus.cn/project/course/")){
  19. //课程主题列表
  20. var themeList=$("tr");
  21. //setInterval(function() {
  22. //},10000)
  23. for(var i=0;i<themeList.length;i++){
  24. var trList = themeList[i].children;
  25. if(trList[3].innerText.trim()=="100.00%"){
  26. continue;
  27. }
  28. //alert(i+1+","+trList[4].firstElementChild.href);
  29. location.href=trList[4].firstElementChild.href;
  30. break;
  31. }
  32. }
  33. //2.进入课程播放页面
  34. if(currenthref && currenthref.startsWith("http://nlts.teacherplus.cn/learning/course/")){
  35. //课程列表
  36. var taskList = $(".task");
  37. for(var j=0;j<taskList.length;j++){
  38. var titList = taskList[0].firstElementChild.children;
  39. if(titList[0].title=="完成")continue;
  40. location.href=titList[4].firstElementChild.href;
  41. break;
  42. }
  43. }
  44. //3.自动播放课程
  45. if(currenthref && currenthref.startsWith("http://nlts.teacherplus.cn/learning/task")){
  46. //主题中的视频列表
  47. var ahref = $("a[href^='/learning/task']");
  48. var index = 0;
  49. setInterval(function() {
  50. //左下角按键(播放/暂停/重播)
  51. var playbutton = $('.vjs-control-bar :button')[0];
  52. //播放完成后的弹窗确认键
  53. var confirmbutton = $('.modal-footer :button')[0];
  54. if(confirmbutton){
  55. confirmbutton.click();
  56. }
  57. if(playbutton.title=="Play"){
  58. playbutton.click();
  59. return;
  60. }else if(playbutton.title=="Replay"){
  61. for(var i=0;i<ahref.length;i++){
  62. if(ahref[i]==currenthref){
  63. index=i+1;
  64. break;
  65. }
  66. }
  67. if(index<ahref.length) {
  68. location.href=ahref[index].href;
  69. }else{
  70. location.href=$("a[href^='/project/course']")[0].href;
  71. }
  72. }
  73. }, 5000);
  74. }
  75. })();

QingJ © 2025

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