建设行业人才网络教育平台刷课脚本分享
# 关于建设行业人才网络教育平台的一些使用感受
建设行业人才网络教育平台,网址是 https://jsrcx.zjjzjy.cn/web/web_toDefault.page,这个平台对于建设行业的朋友们来说应该是挺熟悉的吧。说实话这个平台用起来真的有点麻烦,前几天杭州的王工还跟我吐槽,说这个平台的学习体验真的不太好,视频动不动就停,有时候去工地忙完回来,发现视频都停了快半个小时了,进度一点没往前走,真的让人很着急。
对了,这个平台必须使用360极速浏览器,而且得用极速模式访问,这个估计很多人都知道,刚开始用的时候确实有点不习惯,毕竟大家平时用的浏览器可能不太一样。不过后来慢慢也就习惯了,还好有这个限制,不然可能会更麻烦。
那天下午我刚喝完茶,坐在电脑前,看着群里好几个同行都在抱怨这个平台,心里想着,要是能弄个什么东西能帮大家解决这个问题就好了,毕竟建设行业的朋友们平时工作都那么忙,还要抽时间专门盯着屏幕看课,确实太累了。
说干就干,花了好几个晚上,查了不少资料,试了好多种方法,终于弄出了个能用的脚本。这个脚本是用JavaScript写的油猴脚本,专门适配建设行业人才网络教育平台的。功能大概有这么些:自动播放视频,这个是最基本的;智能检测暂停,要是视频停了会自动恢复播放;还有倍速播放功能,可以自己调整播放速度;防闲置检测,每隔一段时间模拟一下用户操作,防止平台检测到你不在就给暂停了;视频播放完了还会自动跳转下一课,不用你手动点;还有静音功能,自动把视频设成静音,不会吵到别人;另外还有播放进度保护,定期检查播放进度,确保学习记录能正常保存;还有一些防检测的技术,尽量不让平台发现是脚本在运行。
嗯...这个平台的视频播放器有点奇怪,进度条有时候会卡住,得刷新好几次才能好,而且视频声音也不能一直开着,毕竟平时还要工作,太吵了影响别人。还好后来找到方法了,脚本里专门做了处理。
不过啊,脚本安装地址暂时下架了,大家如果有需要的话...
提示
如需代学,请联系客服,支持闲鱼交易。

微信联系:yizhituziang

QQ联系:2422270452
- img: /img/weixin.jpg
name: 微信联系:yizhituziang
- img: /img/qq.jpg
name: QQ联系:2422270452
# 安装步骤
如果有脚本的话,安装其实也不难。首先得给浏览器装个脚本猫或者油猴插件,这是基础。推荐用Edge浏览器,装插件比较方便,兼容性也挺好的。不过这个平台要求用360极速浏览器,所以大家可以在360极速浏览器上也装上脚本猫插件,其实操作都是一样的。
打开 https://docs.scriptcat.org/ 这个网址,用浏览器的话,直接点"添加到浏览器"就行,360极速浏览器也是支持的。

然后点"获取"

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

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

装完插件后,打开脚本安装地址,点"安装脚本"按钮,再点"安装"就行。
装好脚本后,得重新进学习站点,之前打开的页面要刷新一下,脚本才会生效哦。
# 核心代码
// 脚本配置
const options = {
autoPlay: true,
autoNext: true,
autoMute: true,
speed: 1.5,
checkInterval: 700,
activityInterval: 8000,
progressCheckInterval: 20000,
maxRetry: 5
};
let retry = 0;
let lastProgress = Date.now();
// 获取视频元素
function getVideoElement() {
const selectors = [
'video',
'.video-box video',
'#videoPlayerId',
'.course-video video',
'.media-video video',
'[id*="video"]',
'.video-content video',
'iframe video'
];
for (const selector of selectors) {
const element = document.querySelector(selector);
if (element) {
if (element.tagName === 'IFRAME') {
try {
const iframeVideo = element.contentDocument.querySelector('video');
if (iframeVideo) return iframeVideo;
} catch (error) {
continue;
}
}
return element;
}
}
return null;
}
// 设置视频静音
function setMute() {
if (!options.autoMute) return;
const video = getVideoElement();
if (video && !video.muted) {
video.muted = true;
console.log('[建设行业助手] 视频已静音');
}
}
// 设置播放速度
function setSpeed() {
const video = getVideoElement();
if (video && video.playbackRate !== options.speed) {
video.playbackRate = options.speed;
console.log('[建设行业助手] 播放速度设置为 ' + options.speed + 'x');
retry = 0;
}
}
// 自动播放视频
function playVideo() {
const video = getVideoElement();
if (!video) return;
if (video.paused && !video.ended) {
if (retry < options.maxRetry) {
video.play().then(() => {
console.log('[建设行业助手] 视频已自动播放');
retry = 0;
}).catch(err => {
console.log('[建设行业助手] 播放失败,尝试点击播放按钮:', err);
retry++;
const buttons = [
'.play',
'.video-play-button',
'.start-btn',
'.vjs-play',
'.play-icon-button',
'#playVideo',
'[class*="play"]'
];
buttons.forEach(sel => {
const btn = document.querySelector(sel);
if (btn) btn.click();
});
});
}
}
setMute();
setSpeed();
if (options.autoNext && video.ended) {
nextLesson();
}
}
// 导航到下一课
function nextLesson() {
const nextButtons = [
'.next',
'.next-chapter-btn',
'.btn-next',
'.course-next-btn',
'#next',
'[title="下一课"]',
'[title="下一章节"]',
'.item.active + .item a',
'.next-unit-btn',
'.go-next'
];
let nextBtn = null;
for (const sel of nextButtons) {
const element = document.querySelector(sel);
if (element && element.offsetParent !== null) {
nextBtn = element;
break;
}
}
if (nextBtn) {
console.log('[建设行业助手] 正在切换到下一课');
setTimeout(() => {
nextBtn.click();
}, 1700);
} else {
console.log('[建设行业助手] 未找到下一课按钮');
}
}
// 模拟用户活动
function simulateActivity() {
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.48) {
const clickEvent = new MouseEvent('click', {
bubbles: true,
cancelable: true
});
document.body.dispatchEvent(clickEvent);
}
if (Math.random() > 0.68) {
window.scrollBy(0, Math.random() > 0.5 ? 13 : -13);
}
}
// 检查播放进度
function checkProgress() {
const video = getVideoElement();
if (video && !video.paused) {
if (Date.now() - lastProgress > options.progressCheckInterval) {
console.log('[建设行业助手] 播放进度检查正常');
lastProgress = Date.now();
}
}
}
// 自动处理弹窗
function handlePopups() {
const popupSelectors = [
'.modal-container',
'.dialog-box',
'.popup-container',
'.alert-container',
'.verify-container',
'.question-container',
'.exam-container',
'.notice-container'
];
popupSelectors.forEach(sel => {
const popup = document.querySelector(sel);
if (popup && popup.offsetParent !== null) {
const closeButtons = [
'.close-modal',
'.btn-close',
'.modal-close',
'.dialog-close',
'.confirm',
'.ok',
'[class*="close"]',
'[class*="confirm"]'
];
closeButtons.forEach(btnSel => {
const btn = popup.querySelector(btnSel);
if (btn) {
btn.click();
console.log('[建设行业助手] 已处理弹窗');
}
});
}
});
}
// 设置防检测
function setupAntiCheck() {
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 start() {
console.log('[建设行业助手] 脚本已加载');
setupAntiCheck();
setInterval(() => {
if (options.autoPlay) {
playVideo();
}
handlePopups();
}, options.checkInterval);
setInterval(simulateActivity, options.activityInterval);
setInterval(checkProgress, options.progressCheckInterval);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', start);
} else {
start();
}