学堂云视频加速

一个学堂云视频播放加速脚本

  1. // ==UserScript==
  2. // @name xuetangx video speedup
  3. // @name:zh 学堂云视频加速
  4. // @name:zh-CN 学堂云视频加速
  5. // @namespace https://gf.qytechs.cn/zh-CN/scripts/377956-xuetangx-video-speedup/
  6. // @homepage http://blog.shlll.top/
  7. // @version 0.0.2
  8. // @description A xuetangx video speedup script.
  9. // @description:zh 一个学堂云视频播放加速脚本
  10. // @description:zh-CN 一个学堂云视频播放加速脚本
  11. // @author SHLLL
  12. // @include https://*.xuetangx.com/lms*
  13. // @grant unsafeWindow
  14. // @run-at document-end
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19.  
  20. function speedUp() {
  21. let ele = document.getElementsByClassName('xt_video_player_speed')[0].getElementsByClassName('xt_video_player_common_list')[0].childNodes[0];
  22. ele.setAttribute('data-speed', 64);
  23. ele.innerText = '64.0x';
  24.  
  25. //let newEle = document.createElement('li');
  26. //newEle.setAttribute('data-speed', 64);
  27. //newEle.innerText = '64.0x';
  28. //ele.parentNode.insertBefore(newEle, ele);
  29.  
  30. if(window.Notification && Notification.permission !== "denied") {
  31. Notification.requestPermission(function(status) {
  32. var n = new Notification('学堂云加速', { body:'在播放器中选择播放速度吧!' });
  33. });
  34. }
  35. }
  36.  
  37. unsafeWindow.onload = ()=>{
  38. console.log('学堂云视频加速器');
  39. let url = unsafeWindow.location.href;
  40. if(url.indexOf('video') !== -1) {
  41. setTimeout(speedUp, 100);
  42. }
  43. unsafeWindow.onhashchange = (e)=>{
  44. console.log('检测到url更改');
  45. let curUrl = e.newURL;
  46. if(url.indexOf('video') !== -1) {
  47. setTimeout(speedUp, 100);
  48. }
  49. }
  50. }
  51.  
  52.  
  53. })();

QingJ © 2025

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