南京智慧人社继续教育系统在线辅助-自动播放

南京专技人员继续教育平台、继续教育专业课学习平台(公需课),自动播放课程列表,自动跳过弹窗。截至目前2023年6月,插件可用

  1. // ==UserScript==
  2. // @name 南京智慧人社继续教育系统在线辅助-自动播放
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.7
  5. // @description 南京专技人员继续教育平台、继续教育专业课学习平台(公需课),自动播放课程列表,自动跳过弹窗。截至目前2023年6月,插件可用
  6. // @author Znonymous
  7. // @match https://m.mynj.cn:11188/*
  8. // @match https://jxjy.mynj.cn:8283/*
  9. // @match http://180.101.236.114:8283/*
  10. // @run-at document-end
  11. // @grant GM_notification
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. function playVideo() {
  17. if (document.querySelector("video")) {
  18. console.log("检查是否有视频");
  19. let player = document.querySelector("video")
  20. if (player.paused) {
  21. console.log("检查是否暂停");
  22. player.play();
  23. }
  24. }
  25. }
  26.  
  27. // function setPlayerPercent(percent) {
  28. // if (document.querySelector("video")) {
  29. // let player = document.querySelector("video")
  30. // player.currentTime = player.duration*percent/100
  31. // }
  32. // }
  33.  
  34. function startLearning() {
  35. let url = location.href;
  36.  
  37. if (url.includes("https://m.mynj.cn:11188/zxpx/tec/play/player") || url.includes("http://180.101.236.114:8283/rsrczxpx/tec/play/player") || url.includes("https://jxjy.mynj.cn:8283/rsrczxpx/tec/play/player")) {
  38. // 视频是否暂停
  39. playVideo()
  40. // 消除中间播放的弹窗
  41. let messageDialog = document.querySelector('.dialog-button a')
  42. if (messageDialog) {
  43. console.log("有弹窗,点击")
  44. messageDialog.click()
  45. setTimeout(() => {
  46. console.log("弹窗后,播放视频")
  47. playVideo()
  48. }, 2000)
  49. }
  50.  
  51. let learnpercent = document.querySelector(".learnpercent span span").textContent
  52. if (learnpercent === "已完成") {
  53. console.log("完成课程")
  54. const unfinishedDom = Array.prototype.slice.call(document.querySelectorAll('.ztree a.level0'))
  55. .filter(function (el) {
  56. return el.innerText.includes('未开始') || el.innerText.includes('未完成')
  57. })[0]
  58. if (unfinishedDom) {
  59. unfinishedDom.click()
  60. } else {
  61. GM_notification({
  62. title: "课程已经完成",
  63. text: "已经完成,请返回页面确认",
  64. highlight: true,
  65. })
  66. }
  67. } else {
  68. if (!document.querySelector("video")) {
  69. console.log("没有视频了,还没看完")
  70. GM_notification({
  71. title: "没有视频了,还没看完",
  72. text: "请返回页面重新拖动进度条",
  73. })
  74. }
  75. }
  76. }
  77. }
  78. let myTimer = setInterval(startLearning, 3000);
  79. })()

QingJ © 2025

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