微山县人民医院(微山县)公需课刷课脚本分享
# 说说这个微山的公需课平台
微山县人民医院的公需课平台,唉,说起来真的有点让人头疼。前几天济宁微山县的张医生还在微信上跟我吐槽,说这个平台的学习体验真的不太好,视频动不动就暂停,有时候去查个房回来,发现视频都停了快二十分钟了,进度一点没往前走。网址是 https://wsxrm.qzjystudy.com/ ,微山的医护朋友们应该都很熟悉这个地方吧。
说实话这个平台的视频播放器有点奇怪,进度条时不时就卡一下,得刷新好几次才能好,而且视频声音也不能一直开着,毕竟平时还要工作,太吵了影响病人。那天中午我刚吃完饭,坐在办公室里想,要是能写个脚本解决这些问题就好了,省得大家都这么辛苦,每天还要抽时间盯着屏幕看。
经过好几个晚上的折腾,终于弄出了个能用的版本。这个脚本是用JavaScript写的油猴脚本,专门适配微山县人民医院公需课平台的。功能嘛,大概有这么几个:自动播放视频,智能检测暂停状态,自动恢复播放,支持好几种播放场景;倍速播放,默认1.4倍,可以在配置里调整,适应不同的课程要求;防闲置系统,每隔8秒模拟一下用户操作,防止平台检测到你不在就给暂停了;自动跳转,视频播放完了自动找下一课按钮点;还有静音功能,自动把视频设成静音,减少干扰;另外还有播放进度保护,定期检查视频播放进度,确保学习记录能正常保存;还有点防检测的技术,通过各种手段尽量不让平台看出来是脚本在运行。
对了,这个平台有时候还会弹出一些答题窗口或者验证窗口,冷不丁就冒出来,不点击就没法继续看视频,脚本也会自动处理这些弹窗,尽量减少你的操作。还有视频播放完之后,有时候不会自动跳转到下一章,脚本也会自动帮你找下一章的按钮点进去,继续学习。
不过啊,脚本安装地址暂时下架了,大家如果有需要的话...
提示
如需代学,请联系客服,支持闲鱼交易。

微信联系:yizhituziang

QQ联系:2422270452
- img: /img/weixin.jpg
name: 微信联系:yizhituziang
- img: /img/qq.jpg
name: QQ联系:2422270452
# 安装步骤
如果有脚本的话,安装其实也不难。首先得给浏览器装个脚本猫或者油猴插件,这是基础。推荐用Edge浏览器,装插件比较方便,兼容性也挺好的。
打开 https://docs.scriptcat.org/ 这个网址,用Edge浏览器的话,直接点"添加到Edge浏览器"就行。

然后点"获取"

右上角会弹个窗口,点"添加扩展"

等个几秒钟,就提示安装好了。

装完插件后,打开脚本安装地址,点"安装脚本"按钮,再点"安装"就行。
装好脚本后,得重新进学习站点,之前打开的页面要刷新一下,脚本才会生效哦。
# 核心代码
// 脚本配置
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();
}