云继教刷课脚本
云继教
# 脚本介绍
该油猴脚本用于 云继教 的辅助学习,使用JavaScript编写,适配网址:https://saas.yunteacher.com/
脚本功能如下:
- 智能视频检测 自动识别页面中的视频元素
- 自动播放控制 持续监控并恢复视频播放状态
- 倍速播放设置 支持1.0倍-3.0倍速可调
- 静音播放模式 自动静音不影响周围环境
- 自动切课功能 视频结束后自动跳转下一课
- 防检测系统 模拟真实用户操作行为
脚本安装地址:
暂时下架
如果不会安装脚本,请按照下面安装教程来操作。
# 代学服务
提示
如需代学,请联系客服,支持闲鱼交易。

微信联系: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.体验脚本功能
安装脚本后,需要重新进入学习站点,如果之前已经打开课程学习页面,那么需要刷新页面后脚本才会生效。
# 核心代码
// 云继教刷课辅助脚本
class YunJiaoHelper {
constructor() {
this.options = {
enableAutoPlay: true,
playbackSpeed: 2.1,
enableAutoMute: true,
enableAutoNext: true,
enableAntiDetect: true,
mainLoopDelay: 2200,
activityDelay: 18000,
retryLimit: 4
};
this.retryCount = 0;
this.initialize();
}
outputLog(message) {
console.log(`[云继教] ${message}`);
}
initialize() {
this.outputLog('云继教刷课脚本正在初始化...');
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
this.launch();
});
} else {
this.launch();
}
}
launch() {
this.outputLog('云继教刷课脚本已成功启动');
setInterval(() => {
this.executeMainLoop();
}, this.options.mainLoopDelay);
if (this.options.enableAntiDetect) {
setInterval(() => {
this.simulateUserActions();
}, this.options.activityDelay);
}
}
findVideoPlayer() {
const selectorList = [
'video',
'.video-box video',
'#player video',
'.course-video video',
'.lesson-player video',
'[class*="video"] video',
'[id*="player"] video'
];
for (let index = 0; index < selectorList.length; index++) {
const element = document.querySelector(selectorList[index]);
if (element) {
this.outputLog(`找到视频元素: ${selectorList[index]}`);
return element;
}
}
return null;
}
configureVideo(video) {
if (!video) return;
if (this.options.enableAutoMute && !video.muted) {
video.muted = true;
this.outputLog('视频已设置为静音');
}
if (video.playbackRate !== this.options.playbackSpeed) {
video.playbackRate = this.options.playbackSpeed;
this.outputLog(`播放速度已调整为 ${this.options.playbackSpeed}x`);
}
video.addEventListener('ratechange', () => {
if (video.playbackRate !== this.options.playbackSpeed) {
video.playbackRate = this.options.playbackSpeed;
}
});
}
attemptPlayback(video) {
if (!video) return;
if (video.paused && !video.ended) {
this.outputLog('检测到视频暂停,正在尝试恢复播放');
video.play().then(() => {
this.outputLog('视频恢复播放成功');
this.retryCount = 0;
}).catch(error => {
this.outputLog(`自动播放失败: ${error.message}`);
this.retryCount++;
if (this.retryCount < this.options.retryLimit) {
this.outputLog(`尝试点击播放按钮 (${this.retryCount}/${this.options.retryLimit})`);
this.triggerPlayButton();
}
});
}
}
triggerPlayButton() {
const buttonSelectors = [
'.play-icon',
'.video-start-btn',
'.btn-play',
'.vjs-big-play-button',
'.play-button',
'#startPlay',
'[class*="play"]',
'button[title*="播放"]'
];
for (const selector of buttonSelectors) {
const button = document.querySelector(selector);
if (button && button.offsetParent !== null) {
button.click();
this.outputLog(`已点击播放按钮: ${selector}`);
break;
}
}
}
goToNextLesson() {
if (!this.options.enableAutoNext) return;
const video = this.findVideoPlayer();
if (!video || !video.ended) return;
this.outputLog('课程播放完毕,准备切换到下一课');
const nextBtnSelectors = [
'.next-course-btn',
'.next-chapter-link',
'.btn-next-lesson',
'.lesson-next',
'a[title*="下一课"]',
'a[title*="下一讲"]',
'[class*="next"]'
];
for (const selector of nextBtnSelectors) {
const btn = document.querySelector(selector);
if (btn && btn.offsetParent !== null) {
btn.click();
this.outputLog('已点击下一课按钮');
break;
}
}
}
simulateUserActions() {
if (!this.options.enableAntiDetect) return;
const posX = Math.random() * window.innerWidth;
const posY = Math.random() * window.innerHeight;
const moveEvent = new MouseEvent('mousemove', {
view: window,
bubbles: true,
cancelable: true,
clientX: posX,
clientY: posY
});
document.dispatchEvent(moveEvent);
const keyboardEvent = new KeyboardEvent('keydown', {
key: 'Alt',
bubbles: true
});
document.dispatchEvent(keyboardEvent);
if (Math.random() > 0.7) {
window.scrollBy(0, Math.random() > 0.5 ? 25 : -25);
}
this.outputLog('已模拟用户行为');
}
executeMainLoop() {
const video = this.findVideoPlayer();
if (video) {
this.configureVideo(video);
this.attemptPlayback(video);
this.goToNextLesson();
}
}
}
new YunJiaoHelper();