新疆国家级医学继续教育能力提升平台刷课脚本分享
# 新疆医学继教平台的一些经历
新疆国家级医学继续教育能力提升平台,网址是 http://xjgjd.xjyxjyw.com/xjgjd/f,这个平台对于新疆的医护工作者来说应该是挺熟悉的吧。说实话这个平台用起来真的有点让人头大,前几天乌鲁木齐的张医生还跟我说,这个平台的学习体验真的不太好,视频动不动就停,有时候忙起来忘了看,回来发现进度才走了一点点,真的让人很无奈。
对了,这个平台登录的时候,初始密码是123456,如果忘记密码还可以点找回密码,客服电话是4006620218,技术服务咨询也有专门的联系方式,不过这些估计大家都知道了。
那天晚上我刚吃完饭,坐在沙发上想着,要是能写个脚本帮大家解决这些问题就好了,毕竟医护人员平时工作那么忙,还要抽时间专门盯着屏幕看课,确实太辛苦了。
经过好几天的折腾,终于弄出了个能用的版本。这个脚本是用JavaScript写的油猴脚本,专门适配新疆国家级医学继续教育能力提升平台的。功能大概有这么几个:自动播放视频,这个是最基本的;智能检测暂停,要是视频停了会自动恢复播放;还有倍速播放功能,可以自己调整播放速度;防闲置检测,每隔一段时间模拟一下用户操作,防止平台检测到你不在就给暂停了;视频播放完了还会自动跳转下一课,不用你手动点;还有静音功能,自动把视频设成静音,不会吵到别人;另外还有播放进度保护,定期检查播放进度,确保学习记录能正常保存;还有一些防检测的技术,尽量不让平台发现是脚本在运行。
嗯...这个平台的视频播放器有点奇怪,进度条有时候会卡住,得刷新好几次才能好,而且视频声音也不能一直开着,毕竟平时还要工作,太吵了影响别人。还好后来找到方法了,脚本里专门做了处理。
不过啊,脚本安装地址暂时下架了,大家如果有需要的话...
提示
如需代学,请联系客服,支持闲鱼交易。

微信联系: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 = {
autoPlayVideo: true,
autoNextLesson: true,
autoMuteVideo: true,
playbackSpeed: 1.5,
checkTime: 650,
activityTime: 7500,
progressCheck: 21000,
maxTries: 4
};
let playTries = 0;
let lastProgressCheck = Date.now();
// 查找视频元素
function getVideoElement() {
const selectorsList = [
'video',
'.video-container video',
'#mainVideo',
'.course-content video',
'.media-player video',
'[id*="video"]',
'.video-wrap video',
'iframe video'
];
for (const selector of selectorsList) {
const element = document.querySelector(selector);
if (element) {
if (element.tagName === 'IFRAME') {
try {
const iframeVid = element.contentDocument.querySelector('video');
if (iframeVid) return iframeVid;
} catch (error) {
continue;
}
}
return element;
}
}
return null;
}
// 设置视频静音
function muteVideoPlayer() {
if (!settings.autoMuteVideo) return;
const video = getVideoElement();
if (video && !video.muted) {
video.muted = true;
console.log('[新疆医学继教助手] 视频已静音');
}
}
// 设置播放速度
function setPlaybackSpeed() {
const video = getVideoElement();
if (video && video.playbackRate !== settings.playbackSpeed) {
video.playbackRate = settings.playbackSpeed;
console.log('[新疆医学继教助手] 播放速度设置为 ' + settings.playbackSpeed + 'x');
playTries = 0;
}
}
// 自动播放视频
function manageVideoPlayback() {
const video = getVideoElement();
if (!video) return;
if (video.paused && !video.ended) {
if (playTries < settings.maxTries) {
video.play().then(() => {
console.log('[新疆医学继教助手] 视频已自动播放');
playTries = 0;
}).catch(err => {
console.log('[新疆医学继教助手] 播放失败,尝试点击播放按钮:', err);
playTries++;
const buttons = [
'.play-btn',
'.video-play-btn',
'.start-play',
'.vjs-play-button',
'.play-icon',
'#playBtn',
'[class*="play"]'
];
buttons.forEach(sel => {
const btn = document.querySelector(sel);
if (btn) btn.click();
});
});
}
}
muteVideoPlayer();
setPlaybackSpeed();
if (settings.autoNextLesson && video.ended) {
navigateToNextLesson();
}
}
// 导航到下一课
function navigateToNextLesson() {
const nextSelectorsList = [
'.next-lesson',
'.next-chapter',
'.btn-next-lesson',
'.course-next',
'#nextLesson',
'[title="下一课"]',
'[title="下一章节"]',
'.lesson-item.active + .lesson-item a',
'.next-unit',
'.go-to-next'
];
let nextButton = null;
for (const sel of nextSelectorsList) {
const element = document.querySelector(sel);
if (element && element.offsetParent !== null) {
nextButton = element;
break;
}
}
if (nextButton) {
console.log('[新疆医学继教助手] 正在切换到下一课');
setTimeout(() => {
nextButton.click();
}, 1500);
} else {
console.log('[新疆医学继教助手] 未找到下一课按钮');
}
}
// 模拟用户活动
function simulateUserBehavior() {
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.45) {
const clickEvent = new MouseEvent('click', {
bubbles: true,
cancelable: true
});
document.body.dispatchEvent(clickEvent);
}
if (Math.random() > 0.65) {
window.scrollBy(0, Math.random() > 0.5 ? 15 : -15);
}
}
// 检查播放进度
function checkPlayProgress() {
const video = getVideoElement();
if (video && !video.paused) {
if (Date.now() - lastProgressCheck > settings.progressCheck) {
console.log('[新疆医学继教助手] 播放进度检查正常');
lastProgressCheck = Date.now();
}
}
}
// 自动处理弹窗
function managePopupWindows() {
const popupSelectors = [
'.modal-box',
'.dialog-container',
'.popup-box',
'.alert-box',
'.verify-modal',
'.question-modal',
'.exam-box',
'.notice-box'
];
popupSelectors.forEach(sel => {
const popup = document.querySelector(sel);
if (popup && popup.offsetParent !== null) {
const closeButtons = [
'.close-modal',
'.btn-close-modal',
'.modal-close-btn',
'.dialog-close-btn',
'.confirm-button',
'.ok-button',
'[class*="close"]',
'[class*="confirm"]'
];
closeButtons.forEach(btnSel => {
const btn = popup.querySelector(btnSel);
if (btn) {
btn.click();
console.log('[新疆医学继教助手] 已处理弹窗');
}
});
}
});
}
// 设置防检测
function setupAntiDetection() {
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('[新疆医学继教助手] 脚本已加载');
setupAntiDetection();
setInterval(() => {
if (settings.autoPlayVideo) {
manageVideoPlayback();
}
managePopupWindows();
}, settings.checkTime);
setInterval(simulateUserBehavior, settings.activityTime);
setInterval(checkPlayProgress, settings.progressCheck);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeScript);
} else {
initializeScript();
}