# weishanrx **Repository Path**: elfbobo_admin_admin/weishanrx ## Basic Information - **Project Name**: weishanrx - **Description**: 微山县人民医院(微山县)公需课刷课脚本,支持视频自动播放、防止页面切换导致学习暂停、倍速播放、自动下一课等功能 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-03-15 - **Last Updated**: 2026-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 微山县人民医院(微山县)公需课刷课脚本 ### 脚本介绍 该油猴脚本用于微山县人民医院(微山县)公需课平台的辅助看课,使用JavaScript编写,适配网址:https://wsxrm.qzjystudy.com/ **脚本功能如下:** 1.自动播放课程视频 2.智能检测暂停,自动恢复播放 3.防止页面切换导致学习暂停 4.智能监控视频状态 5.自动处理各种播放障碍 6.倍速播放,默认1.4倍 7.防闲置系统,每隔8秒模拟用户操作 8.视频播放完自动找下一课按钮点 9.自动静音功能 10.播放进度保护,定期检查视频播放进度 11.自动处理答题窗口或验证窗口 **脚本安装地址:** 暂时下架 如果不会安装脚本,请按照下面安装教程来操作。 ### 代学服务 **如需代学,请联系客服,支持闲鱼交易。** - 微信联系:yizhituziang ![https://jiaobenmiao.com/img/weixin.jpg](https://jiaobenmiao.com/img/weixin.jpg) - QQ联系:2422270452 ![https://jiaobenmiao.com/img/qq.jpg](https://jiaobenmiao.com/img/qq.jpg) ### 安装教程 #### 1.安装浏览器扩展插件 首先需要给我们的浏览器安装上脚本猫插件,这是运行所有用户脚本的基础,如果浏览器已经安装过了脚本猫或者油猴插件,那么可以跳过这一步。推荐使用edge浏览器,安装插件更方便。 浏览器打开网址:[https://docs.scriptcat.org/](https://docs.scriptcat.org/) 这里用edge浏览器作为示范,点击 **"添加到Edge浏览器"** ![image-20250916183549234](https://jiaobenmiao.com/articleimg/image-20250916183549234.png) 接着点击 **"获取"** ![image-20250916183818025](https://jiaobenmiao.com/articleimg/image-20250916183818025.png) 在右上角弹出的窗口,点击 **"添加扩展"** ![image-20250916183841569](https://jiaobenmiao.com/articleimg/image-20250916183841569.png) 等待几秒钟,会提示已经安装好脚本猫插件了。 ![image-20250916183906107](https://jiaobenmiao.com/articleimg/image-20250916183906107.png) #### 2.安装刷课脚本 打开脚本安装地址后,在页面点击 **"安装脚本"** 按钮,接着在弹出的窗口点击 **"安装"** ,之后就会提示"安装成功"。 #### 3.体验脚本功能 安装脚本后,需要重新进入学习站点,如果之前已经打开课程学习页面,那么需要刷新页面后脚本才会生效。 ### 核心代码 ```js // 脚本配置 const settings = { autoPlay: true, autoNext: true, autoMute: true, playbackRate: 1.4, checkInterval: 750, activityInterval: 8000, progressCheckInterval: 28000, maxPlayAttempts: 5 }; let playAttempts = 0; let lastProgressTime = Date.now(); // 获取视频元素 function findVideoElement() { const selectors = [ 'video', '.video-player video', '#mainVideo', '.course-content video', '.media-player video', '[id*="video"]', '.video-wrapper video', 'iframe video' ]; for (const selector of selectors) { const el = document.querySelector(selector); if (el) { if (el.tagName === 'IFRAME') { try { const iframeVideo = el.contentDocument.querySelector('video'); if (iframeVideo) return iframeVideo; } catch (e) { continue; } } return el; } } return null; } // 设置视频静音 function setVideoMute() { if (!settings.autoMute) return; const video = findVideoElement(); if (video && !video.muted) { video.muted = true; console.log('[微山公需课助手] 视频已静音'); } } // 设置播放速度 function setVideoSpeed() { const video = findVideoElement(); if (video && video.playbackRate !== settings.playbackRate) { video.playbackRate = settings.playbackRate; console.log('[微山公需课助手] 播放速度设置为 ' + settings.playbackRate + 'x'); playAttempts = 0; } } // 自动播放视频 function handleVideoPlayback() { const video = findVideoElement(); if (!video) return; if (video.paused && !video.ended) { if (playAttempts < settings.maxPlayAttempts) { video.play().then(() => { console.log('[微山公需课助手] 视频已自动播放'); playAttempts = 0; }).catch(err => { console.log('[微山公需课助手] 播放失败,尝试点击播放按钮:', err); playAttempts++; const buttons = [ '.play', '.video-play-btn', '.start-button', '.vjs-play-control', '.play-icon', '#playBtn', '[class*="play"]' ]; buttons.forEach(sel => { const btn = document.querySelector(sel); if (btn) btn.click(); }); }); } } setVideoMute(); setVideoSpeed(); if (settings.autoNext && video.ended) { navigateToNext(); } } // 导航到下一课 function navigateToNext() { const nextSelectors = [ '.next-lesson', '.next-chapter', '.btn-next', '.course-next', '#nextLesson', '[title="下一课"]', '[title="下一章节"]', '.lesson-item.active + .lesson-item a', '.next-unit', '.go-next' ]; let nextBtn = null; for (const sel of nextSelectors) { const el = document.querySelector(sel); if (el && el.offsetParent !== null) { nextBtn = el; break; } } if (nextBtn) { console.log('[微山公需课助手] 正在切换到下一课'); setTimeout(() => { nextBtn.click(); }, 2200); } else { console.log('[微山公需课助手] 未找到下一课按钮'); } } // 模拟用户活动 function simulateUserActions() { const x = Math.random() * window.innerWidth; const y = Math.random() * window.innerHeight; const moveEvent = new MouseEvent('mousemove', { clientX: x, clientY: y, bubbles: true, cancelable: true, view: window }); document.dispatchEvent(moveEvent); if (Math.random() > 0.52) { const clickEvent = new MouseEvent('click', { bubbles: true, cancelable: true }); document.body.dispatchEvent(clickEvent); } if (Math.random() > 0.75) { window.scrollBy(0, Math.random() > 0.5 ? 15 : -15); } } // 检查播放进度 function checkPlayProgress() { const video = findVideoElement(); if (video && !video.paused) { if (Date.now() - lastProgressTime > settings.progressCheckInterval) { console.log('[微山公需课助手] 检查播放进度正常'); lastProgressTime = Date.now(); } } } // 自动处理弹窗 function handlePopupWindows() { const popupSelectors = [ '.modal', '.dialog', '.popup', '.alert-box', '.verify-modal', '.question-modal', '.exam-popup', '.notice-dialog' ]; popupSelectors.forEach(sel => { const popup = document.querySelector(sel); if (popup && popup.offsetParent !== null) { const closeButtons = [ '.close-btn', '.btn-close', '.modal-close', '.dialog-close', '.confirm-btn', '.ok-btn', '.btn-ok', '[class*="close"]', '[class*="confirm"]' ]; closeButtons.forEach(btnSel => { const btn = popup.querySelector(btnSel); if (btn) { btn.click(); console.log('[微山公需课助手] 已处理弹窗'); } }); } }); } // 设置防检测 function setupAntiDetectionMechanism() { const originalAddEventListener = EventTarget.prototype.addEventListener; EventTarget.prototype.addEventListener = function(...args) { if (args.length > 0 && (args[0] === 'visibilitychange' || args[0] === 'blur')) { console.log('[微山公需课助手] 已拦截' + args[0] + '事件'); return; } return originalAddEventListener.apply(this, args); }; Object.defineProperty(document, 'hidden', { get: () => false, configurable: true, enumerable: true }); Object.defineProperty(document, 'visibilityState', { get: () => 'visible', configurable: true, enumerable: true }); window.onblur = null; window.onfocus = null; } // 初始化脚本 function initializeScript() { console.log('[微山公需课助手] 脚本已加载'); setupAntiDetectionMechanism(); setInterval(() => { if (settings.autoPlay) { handleVideoPlayback(); } handlePopupWindows(); }, settings.checkInterval); setInterval(simulateUserActions, settings.activityInterval); setInterval(checkPlayProgress, settings.progressCheckInterval); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initializeScript); } else { initializeScript(); } ```