// ==UserScript== // @name 2025年全年暑假/寒假教师研修|国家智慧教育公共服务平台|国家中小学智慧教育平台|自动刷视频,可秒刷视频!适合中小学(基础教育) | 职业教育,部分功能自愿付费使用 详情咨询客服微信:wkds857 // @namespace https://greasyfork.org/users/智慧教育平台自动刷视频助手 // @version 1.0.0 // @description 自动刷国家智慧教育公共服务平台、国家中小学智慧教育平台的视频,支持秒刷。 详情咨询客服微信:wkds857 // @author 9.2 // @match ://www.smartedu.cn/ // 国家智慧教育公共服务平台 (示例) // @match ://www.zxx.edu.cn/ // 国家中小学智慧教育平台 (示例) // @grant GM_xmlhttpRequest // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle // @require https://cdn.jsdelivr.net/npm/sweetalert2@11 (或其他弹窗库) // ==/UserScript== (function() { 'use strict'; // --- 全局变量 --- let currentPlatform = null; // 当前平台标识 const platformMap = { // 定义平台处理规则,需要根据平台定制 "smartedu": { matchPatterns: ["smartedu.cn"], videoSelector: 'video', // 视频选择器 (根据实际情况修改) nextButtonSelector: null, // 下一集按钮选择器 (根据实际情况修改) courseListSelector: null, // 课程列表选择器 (根据实际情况修改,用于自动获取课程) courseLinkSelector: null, // 课程链接选择器 (根据实际情况修改) autoNext: false, // 是否自动下一集 autoGetCourse: false, //是否自动获取课程 skipWaitTime: 0, // ... 其他平台特定配置 }, "zxx": { matchPatterns: ["zxx.edu.cn"], videoSelector: 'video', // 视频选择器 (根据实际情况修改) nextButtonSelector: null, // 下一集按钮选择器 (根据实际情况修改) courseListSelector: null, // 课程列表选择器 (根据实际情况修改,用于自动获取课程) courseLinkSelector: null, // 课程链接选择器 (根据实际情况修改) autoNext: false, // 是否自动下一集 autoGetCourse: false, //是否自动获取课程 skipWaitTime: 0, } // ... 更多平台的配置 }; let taskState = { isPlaying: false, isAutoNext:false, isAutoGetCourse:false, skipWaitTime: 0 }; const customerServiceWeChat = 'wkds857'; // 您的客服微信 // --- 工具函数 --- function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function showNotification(title, message, icon = 'info') { Swal.fire({ title: title, text: message, icon: icon, confirmButtonText: '好的' }); } //检测平台 function identifyPlatform() { const url = window.location.href; for (const platform in platformMap) { if (platformMap.hasOwnProperty(platform)) { const matchPatterns = platformMap[platform].matchPatterns; if(matchPatterns){ for(let i = 0 ; i= video.duration - taskState.skipWaitTime ){ showNotification("提示","当前视频已经完成,请注意!"); } // 自动下一集 if(taskState.isAutoNext){ const nextButton = getNextButtonElement(platform); if (nextButton) { nextButton.click(); await sleep(3000); // 等待页面加载 }else{ console.warn([${platform}] 未找到“下一集”按钮); taskState.isAutoNext = false; // 暂停自动 showNotification("提示", "未找到“下一集”按钮,暂停自动播放", "warning"); break; } }else{ await sleep(5000); break; } } showNotification("自动刷视频完成", 视频已观看完毕。如有问题,请联系客服微信:${customerServiceWeChat}, "success"); } function autoGetCourse(platform){ if (!platform) return; showNotification("启动自动获取课程", "开始自动获取课程..."); const courseLinkElements = getCourseLinkElement(platform); if(!courseLinkElements || courseLinkElements.length == 0){ showNotification("提示", "未找到课程链接,请手动打开一个!","warning"); return; } showNotification("提示", 检测到${courseLinkElements.length}个课程,请开启自动刷视频); } // --- 初始化 --- (function initialize() { currentPlatform = identifyPlatform(); if (currentPlatform) { showNotification("网课助手", 检测到平台: ${currentPlatform}); // unlockCopy(); // 破除复制限制 createControlPanel(currentPlatform); // 启动 (仅当开启自动播放时) //if(taskState.isPlaying){ // autoWatchVideo(currentPlatform) //} // if(taskState.isAutoGetCourse){ // autoGetCourse(currentPlatform); // } } else { showNotification("网课助手", "未检测到支持的网课平台。"); } })(); // --- UI 控制面板 (可自定义) --- function createControlPanel(platform) { const panel = document.createElement('div'); panel.style.position = 'fixed'; panel.style.top = '10px'; panel.style.left = '10px'; panel.style.zIndex = '10000'; // 确保在其他元素之上 panel.style.backgroundColor = 'rgba(0, 0, 0, 0.7)'; panel.style.color = 'white'; panel.style.padding = '10px'; panel.style.borderRadius = '5px'; panel.style.fontFamily = 'sans-serif'; //控制面板元素 let panelHtml =` 自动播放 自动下一集 自动获取课程 秒刷时间:${taskState.skipWaitTime}(秒) 客服微信: ${customerServiceWeChat} `; panel.innerHTML = panelHtml; document.body.appendChild(panel); // 事件监听 panel.querySelector('#autoPlay').addEventListener('change', (event) => { taskState.isPlaying = event.target.checked; if(taskState.isPlaying){ showNotification("提示", 已开始自动播放); autoWatchVideo(currentPlatform); }else { showNotification("提示", 已暂停播放); } }); panel.querySelector('#autoNext').addEventListener('change', (event) => { taskState.isAutoNext = event.target.checked; if(taskState.isAutoNext){ showNotification("提示", 已开启自动下一集); }else { showNotification("提示", 已暂停自动下一集); } }); panel.querySelector('#autoGetCourse').addEventListener('change', (event) => { taskState.isAutoGetCourse = event.target.checked; if(taskState.isAutoGetCourse){ showNotification("提示", 已开启自动获取课程); autoGetCourse(currentPlatform); }else { showNotification("提示", 已暂停自动获取课程); } }); panel.querySelector('#skipTime').addEventListener('change', (event) => { taskState.skipWaitTime = parseFloat(event.target.value); showNotification("提示", 已设置秒刷时间为 ${taskState.skipWaitTime} 秒); }); } })();