甘肃智博继续教育专修学院刷课脚本
甘肃智博继续教育专修学院
# 脚本介绍
该油猴脚本用于 甘肃智博继续教育专修学院 的辅助学习,使用JavaScript编写,适配网址:https://gszbzjjy.sccchina.net/mizar/portal/index.do
脚本功能如下:
- 自动播放视频课程 智能检测视频元素并自动播放
- 解除暂停限制 防止视频被意外暂停
- 防止页面休眠 保持页面活跃状态
- 自动切换课程 视频播放完后自动跳转下一课
- 模拟鼠标操作 随机移动鼠标避免检测
- 倍速播放功能 支持1.2倍到3倍速播放
脚本安装地址:
暂时下架
如果不会安装脚本,请按照下面安装教程来操作。
# 代学服务
提示
如需代学,请联系客服,支持闲鱼交易。

微信联系:yizhituziang

QQ联系:2422270452
- img: /img/weixin.jpg
name: 微信联系:yizhituziang
- img: /img/qq.jpg
name: QQ联系:2422270452
# 安装教程
# 1.安装浏览器扩展插件
首先需要给我们的浏览器安装上脚本猫插件,这是运行所有用户脚本的基础,如果浏览器已经安装过了脚本猫或者油猴插件,那么可以跳过这一步。推荐使用edge浏览器,安装插件更方便。
浏览器打开网址:https://docs.scriptcat.org/ (opens new window)
这里用edge浏览器作为示范,点击 "添加到Edge浏览器"

接着点击 "获取"

在右上角弹出的窗口,点击 "添加扩展"

等待几秒钟,会提示已经安装好脚本猫插件了。

# 2.安装刷课脚本
打开脚本安装地址后,在页面点击 "安装脚本" 按钮,接着在弹出的窗口点击 "安装" ,之后就会提示"安装成功"。
# 3.体验脚本功能
安装脚本后,需要重新进入学习站点,如果之前已经打开课程学习页面,那么需要刷新页面后脚本才会生效。
# 核心代码
(function() {
'use strict';
console.log('🎓 甘肃智博继续教育刷课脚本已加载');
const SETTINGS = {
checkInterval: 800,
videoCheckInterval: 600,
mouseActivityInterval: 25000,
playbackRate: 1.8,
debugMode: false
};
function logMessage(msg) {
if (SETTINGS.debugMode) {
console.log(`[甘肃智博] ${msg}`);
}
}
function bypassVisibilityCheck() {
const originalAddEventListener = EventTarget.prototype.addEventListener;
EventTarget.prototype.addEventListener = function(type, listener, options) {
if (type === 'visibilitychange' || type === 'blur' || type === 'focusout') {
logMessage(`已拦截 ${type} 事件`);
return;
}
return originalAddEventListener.call(this, type, listener, options);
};
Object.defineProperty(document, 'hidden', {
get: () => false,
configurable: true
});
Object.defineProperty(document, 'visibilityState', {
get: () => 'visible',
configurable: true
});
logMessage('页面可见性检测已绕过');
}
function simulateMouseMovement() {
const eventTypes = ['mousemove', 'mouseenter', 'mouseover'];
const randomType = eventTypes[Math.floor(Math.random() * eventTypes.length)];
const posX = Math.floor(Math.random() * window.innerWidth);
const posY = Math.floor(Math.random() * window.innerHeight);
const mouseEvent = new MouseEvent(randomType, {
view: window,
bubbles: true,
cancelable: true,
clientX: posX,
clientY: posY
});
const element = document.elementFromPoint(posX, posY);
if (element) {
element.dispatchEvent(mouseEvent);
}
logMessage(`模拟鼠标活动: ${randomType} at (${posX}, ${posY})`);
}
function locateVideoElement() {
const videoSelectors = [
'video',
'.video-container video',
'#course-video video',
'.player-wrapper video',
'.lesson-video video',
'video[src*="mp4"]',
'video[id*="player"]'
];
for (const selector of videoSelectors) {
const video = document.querySelector(selector);
if (video) {
return video;
}
}
const iframes = document.querySelectorAll('iframe');
for (const iframe of iframes) {
try {
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
const video = iframeDoc.querySelector('video');
if (video) {
return video;
}
} catch (error) {
continue;
}
}
return null;
}
function manageVideoPlayback(video) {
if (!video) return;
if (video.paused) {
video.play().then(() => {
logMessage('视频已自动播放');
}).catch(error => {
logMessage(`播放出错: ${error.message}`);
});
}
if (video.muted) {
video.muted = false;
}
if (video.playbackRate !== SETTINGS.playbackRate) {
video.playbackRate = SETTINGS.playbackRate;
logMessage(`播放速度调整为 ${SETTINGS.playbackRate}x`);
}
video.addEventListener('pause', () => {
logMessage('视频暂停,尝试恢复');
setTimeout(() => video.play(), 400);
});
video.addEventListener('ended', () => {
logMessage('视频播放完毕,切换下一课');
navigateToNextLesson();
});
}
function navigateToNextLesson() {
const nextButtonSelectors = [
'.next-lesson-btn',
'.next-chapter',
'#nextButton',
'[class*="next"]',
'[id*="next"]',
'a:has(span:contains("下一章"))',
'button:contains("下一节")'
];
for (const selector of nextButtonSelectors) {
const nextBtn = document.querySelector(selector);
if (nextBtn && !nextBtn.disabled) {
logMessage('找到下一课按钮,点击中...');
nextBtn.click();
return;
}
}
const lessonList = document.querySelectorAll('.chapter-item, .lesson-item, .course-item');
for (let i = 0; i < lessonList.length; i++) {
const lesson = lessonList[i];
if (lesson.classList.contains('active') || lesson.classList.contains('current')) {
if (lessonList[i + 1]) {
logMessage('切换到下一课程');
lessonList[i + 1].click();
return;
}
}
}
}
function keepPageAwake() {
setInterval(() => {
if (document.hidden) return;
const video = locateVideoElement();
if (video && video.paused) {
video.play();
}
}, SETTINGS.checkInterval);
}
function initializeScript() {
bypassVisibilityCheck();
keepPageAwake();
setInterval(() => {
const video = locateVideoElement();
if (video) {
manageVideoPlayback(video);
}
}, SETTINGS.videoCheckInterval);
setInterval(simulateMouseMovement, SETTINGS.mouseActivityInterval);
logMessage('甘肃智博刷课脚本初始化完成');
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeScript);
} else {
initializeScript();
}
})();