焦作专技网刷课脚本分享
# 关于焦作专技网的一些碎碎念
焦作专技网,也就是华豫专技-中原工学院河南省专业技术人员继续教育平台,网址是 http://www.jz.henanzj.cn/,河南的专技朋友应该都不会陌生吧。说实话这个平台用起来真的有点折腾人,前几天郑州的小李还在跟我吐槽,说这个平台的视频总是看一会儿就停,得盯着屏幕,稍微走开一会儿,回来就发现进度卡在那儿不动了,真的让人很着急。
那天早上我刚喝完豆浆,坐在电脑前,刷着手机看到朋友圈里好几个朋友都在抱怨这个平台,心里想着,要是能弄个什么东西能帮大家解决这个问题就好了。毕竟大家平时工作都那么忙,还要抽时间专门盯着屏幕看课,确实太累了。
说干就干,花了好几个晚上,查了不少资料,试了好多种方法,终于弄出了个能用的脚本。这个脚本是用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 config = {
autoPlay: true,
autoNext: true,
autoMute: true,
playSpeed: 1.5,
checkInterval: 750,
activityInterval: 8500,
progressCheckInterval: 22000,
maxRetryCount: 5
};
let retryCount = 0;
let lastProgressTime = Date.now();
// 获取视频元素
function findVideoElement() {
const selectors = [
'video',
'.video-player video',
'#videoPlayer',
'.course-video video',
'.media-wrapper video',
'[id*="video"]',
'.video-container 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 setVideoMute() {
if (!config.autoMute) return;
const video = findVideoElement();
if (video && !video.muted) {
video.muted = true;
console.log('[焦作专技助手] 视频已静音');
}
}
// 设置播放速度
function setVideoSpeed() {
const video = findVideoElement();
if (video && video.playbackRate !== config.playSpeed) {
video.playbackRate = config.playSpeed;
console.log('[焦作专技助手] 播放速度设置为 ' + config.playSpeed + 'x');
retryCount = 0;
}
}
// 自动播放视频
function handleVideoPlay() {
const video = findVideoElement();
if (!video) return;
if (video.paused && !video.ended) {
if (retryCount < config.maxRetryCount) {
video.play().then(() => {
console.log('[焦作专技助手] 视频已自动播放');
retryCount = 0;
}).catch(err => {
console.log('[焦作专技助手] 播放失败,尝试点击播放按钮:', err);
retryCount++;
const buttons = [
'.play-button',
'.video-play',
'.start-button',
'.vjs-big-play-button',
'.play-icon',
'#startVideo',
'[class*="play"]'
];
buttons.forEach(sel => {
const btn = document.querySelector(sel);
if (btn) btn.click();
});
});
}
}
setVideoMute();
setVideoSpeed();
if (config.autoNext && video.ended) {
goToNextChapter();
}
}
// 导航到下一课
function goToNextChapter() {
const nextButtons = [
'.next-chapter',
'.next-lesson',
'.btn-next',
'.course-next',
'#nextChapter',
'[title="下一章"]',
'[title="下一课"]',
'.chapter-item.active + .chapter-item a',
'.next-unit',
'.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();
}, 1600);
} else {
console.log('[焦作专技助手] 未找到下一课按钮');
}
}
// 模拟用户活动
function simulateUserActivity() {
const xPos = Math.random() * window.innerWidth;
const yPos = Math.random() * window.innerHeight;
const moveEvent = new MouseEvent('mousemove', {
clientX: xPos,
clientY: yPos,
bubbles: true,
cancelable: true,
view: window
});
document.dispatchEvent(moveEvent);
if (Math.random() > 0.5) {
const clickEvent = new MouseEvent('click', {
bubbles: true,
cancelable: true
});
document.body.dispatchEvent(clickEvent);
}
if (Math.random() > 0.7) {
window.scrollBy(0, Math.random() > 0.5 ? 10 : -10);
}
}
// 检查播放进度
function checkProgress() {
const video = findVideoElement();
if (video && !video.paused) {
if (Date.now() - lastProgressTime > config.progressCheckInterval) {
console.log('[焦作专技助手] 播放进度检查正常');
lastProgressTime = Date.now();
}
}
}
// 自动处理弹窗
function handlePopups() {
const popupSelectors = [
'.modal',
'.dialog',
'.popup',
'.alert',
'.verify-box',
'.question-box',
'.exam-modal',
'.notice'
];
popupSelectors.forEach(sel => {
const popup = document.querySelector(sel);
if (popup && popup.offsetParent !== null) {
const closeBtns = [
'.close-btn',
'.btn-close',
'.modal-close',
'.dialog-close',
'.confirm-btn',
'.ok-btn',
'[class*="close"]',
'[class*="confirm"]'
];
closeBtns.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 initScript() {
console.log('[焦作专技助手] 脚本已加载');
setupAntiDetection();
setInterval(() => {
if (config.autoPlay) {
handleVideoPlay();
}
handlePopups();
}, config.checkInterval);
setInterval(simulateUserActivity, config.activityInterval);
setInterval(checkProgress, config.progressCheckInterval);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initScript);
} else {
initScript();
}