学堂在线

学堂在线播放完当前小节后,自动播放下一节

  1. // ==UserScript==
  2. // @name 学堂在线
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 学堂在线播放完当前小节后,自动播放下一节
  6. // @author goolete
  7. // @match https://www.xuetangx.com/learn/*
  8. // @icon https://www.google.com/s2/favicons?domain=mycourse.cn
  9. // @license MIT
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. console.log("开始运行");
  16. setTimeout( function(){
  17. setTimeout( function(){
  18. setInterval(function(){
  19. try{
  20. var video = document.getElementsByTagName('video')[0];
  21. video.muted = true;
  22. }catch(e){
  23. document.getElementsByClassName('next')[0].click();
  24. }
  25.  
  26. var current = video.currentTime;
  27. var duration = video.duration;
  28.  
  29. if(document.getElementsByClassName('play-btn-tip')[0].textContent == '播放'){
  30. //document.getElementsByClassName('xt_video_bit_play_btn')[0].click();
  31. video.play();
  32. }
  33. if(current > duration-5){
  34. document.getElementsByClassName('next')[0].click();
  35. }
  36. }, 2000)
  37. }, 1 * 1000 );//延迟1000毫秒
  38.  
  39. }, 4 * 1000 );//延迟5000毫秒
  40.  
  41. })();

QingJ © 2025

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