自动学习

自动切换,自动模拟鼠标移动--- 开放大学 1.打开播放界面即可(脚本会自动模拟鼠标移动与切换下个视频).

目前为 2022-02-21 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 自动学习
  3. // @namespace http://play.hnzjpx.net/
  4. // @version 0.211
  5. // @description 自动切换,自动模拟鼠标移动--- 开放大学 1.打开播放界面即可(脚本会自动模拟鼠标移动与切换下个视频).
  6. // @description 1.打开播放界面即可(脚本会自动模拟鼠标移动与切换下个视频).
  7. // @description 2.选择地址里面较小的(如http://play.hnzjpx.net/player/483/play?package_id=80)
  8. // @description 3.仅仅适配湖南广播大学/湖南开发大学
  9. // @author MEN
  10. // @match http://play.hnzjpx.net/**
  11. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  12. // @grant none
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. // 483 -496
  20. var tag =1
  21.  
  22.  
  23. //换一段视频
  24. function next_() {
  25. console.log("执行换视频事件!!!")
  26. window.location.href = window.location.href.replace(/[0-9][0-9][0-9]/,parseInt(window.location.href.match(/[0-9][0-9][0-9]/))+1);
  27. }
  28.  
  29. //触发鼠标点击事件
  30. function mouse_(){
  31. console.log("执行鼠标事件")
  32. var evt = document.createEvent("MouseEvents");
  33. evt.initMouseEvent("mousemove", false, false);
  34. document.dispatchEvent(evt);
  35. }
  36.  
  37. //监听当前播放状态
  38.  
  39. function video_() {
  40. console.log("执行播放监听事件"+tag)
  41. document.getElementById(document.getElementById("video").childNodes[0].childNodes[0].id).addEventListener("playing",function (){
  42. console.log("播放没有结束,修改切换标志")
  43. tag = 1;
  44. })
  45. if(tag === 0){
  46. document.getElementById(document.getElementById("video").childNodes[0].childNodes[0].id).addEventListener("ended",next_())
  47. }
  48.  
  49. document.getElementById(document.getElementById("video").childNodes[0].childNodes[0].id).addEventListener("ended",function (){
  50. console.log("播放可能结束,执行切换下一页事件")
  51. tag = 0;
  52. })
  53. mouse_();
  54. }
  55. setInterval(video_,500000)
  56. setInterval(mouse_,30000)
  57.  
  58.  
  59. })();

QingJ © 2025

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