Greasy Fork is available in English.
🐯全网免费仅做一款脚本🐯】、【🚀已完美兼容、智慧树、中国大学mooc、慕课、雨课堂、新国开、超星、学习通、知到、国家开放大学、蓝墨云、职教云、智慧职教、云班课精品课、山东专技、西财在线剩余网站仅支持部分功能🚀】【半兼容、绎通云、U校园、学堂在线】、【😎完美应付测试,全自动答题,一键完成所有资源学习(视频挨个刷时长不存在滴)、视频倍速😎】、
// ==UserScript==
// @name TOD🚀全平台网课助手【学习通 U校园ai 知到 英华 仓辉 雨课堂 职教云】【学起 青书 柠檬 睿学 慕享 出头科技 慕华】【国开 广开 上海开放大学】等平台 客服微信:WKWK796 自动刷课
// @namespace https://github.com/wkwk796
// @version 2.8.6
// @description 🐯全网免费仅做一款脚本🐯】、【🚀已完美兼容、智慧树、中国大学mooc、慕课、雨课堂、新国开、超星、学习通、知到、国家开放大学、蓝墨云、职教云、智慧职教、云班课精品课、山东专技、西财在线剩余网站仅支持部分功能🚀】【半兼容、绎通云、U校园、学堂在线】、【😎完美应付测试,全自动答题,一键完成所有资源学习(视频挨个刷时长不存在滴)、视频倍速😎】、
// @author Wkwk796
// @match *://*.chaoxing.com/*
// @match *://*.zhihuishu.com/*
// @match *://*.chaoxing.com/*
// @match *://mooc1.chaoxing.com/nodedetailcontroller/*
// @match *://*.chaoxing.com/mooc-ans/work/doHomeWorkNew*
// @match *://*.chaoxing.com/work/doHomeWorkNew*
// @match *://*.edu.cn/work/doHomeWorkNew*
// @match *://*.asklib.com/*
// @match *://*.chaoxing.com/*
// @match *://*.hlju.edu.cn/*
// @match *://lms.ouchn.cn/*
// @match *://xczxzdbf.moodle.qwbx.ouchn.cn/*
// @match *://tongyi.aliyun.com/qianwen/*
// @match *://chatglm.cn/*
// @match *://*.zhihuishu.com/*
// @match *://course.ougd.cn/*
// @match *://moodle.syxy.ouchn.cn/*
// @match *://moodle.qwbx.ouchn.cn/*
// @match *://elearning.bjou.edu.cn/*
// @match *://whkpc.hnqtyq.cn:5678/*
// @match *://study.ouchn.cn/*
// @match *://www.51xinwei.com/*
// @match *://*.w-ling.cn/*
// @match *://xuexi.jsou.cn/*
// @match *://*.edu-edu.com/*
// @match *://xuexi.jsou.cn/*
// @match *://spoc-exam.icve.com.cn/*
// @match *://*.icve.com.cn/*
// @match *://zice.cnzx.info/*
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_info
// @grant GM_addStyle
// @grant unsafeWindow
// @grant none
// @license MIT
// @icon https://static.zhihuishu.com/static/img/favicon.ico
// ==/UserScript==
(function() {
'use strict';
// 配置对象,用于存储用户设置
let config = {
autoPlay: true, // 自动播放
autoMute: true, // 自动静音
autoNextVideo: true, // 自动跳转下一节
skipCompletedVideos: true, // 跳过已完成视频
disablePageMonitoring: true, // 禁用页面监控
customSpeed: 1.0, // 自定义播放速度
advancedMode: true, // 高级播放模式
highlightCompleted: true // 高亮显示已完成视频
};
// 加载配置
function loadConfig() {
const savedConfig = localStorage.getItem('chaoxingVideoPlayerConfig');
if (savedConfig) {
try {
config = {...config, ...JSON.parse(savedConfig)};
} catch (e) {
console.error('加载配置失败:', e);
}
}
}
// 保存配置
function saveConfig() {
localStorage.setItem('chaoxingVideoPlayerConfig', JSON.stringify(config));
}
// 高亮显示已完成视频
function highlightCompletedVideos() {
if (!config.highlightCompleted) return;
// 查找课程列表项
const courseItems = document.querySelectorAll('.catalog_chapter_item, .catalog_lesson_item, .chapter_item, .lesson_item');
courseItems.forEach(item => {
// 方法1: 检查是否有完成标记
const completedMark = item.querySelector('.fl.checkbox.g-checkoff, .icon-check, .catalog_lesson_icofinish');
// 方法2: 检查进度条是否显示100%
const progressBar = item.querySelector('.progressbar .progress, .progressBar');
const isCompletedByProgress = progressBar && (progressBar.style.width === '100%' || progressBar.textContent.includes('100%'));
// 如果是已完成视频
if (completedMark || isCompletedByProgress) {
item.style.backgroundColor = '#e8f5e9';
item.style.borderLeft = '4px solid #4caf50';
item.style.borderRadius = '4px';
item.style.padding = '8px';
item.style.transition = 'all 0.3s ease';
// 添加完成标记
if (!item.querySelector('.custom-complete-mark')) {
const mark = document.createElement('span');
mark.className = 'custom-complete-mark';
mark.textContent = '✓';
mark.style.cssText = `
color: #4caf50;
font-weight: bold;
margin-right: 8px;
font-size: 16px;
`;
const titleElement = item.querySelector('.title, .content');
if (titleElement) {
titleElement.prepend(mark);
}
}
} else {
// 重置样式(如果之前添加过)
item.style.backgroundColor = '';
item.style.borderLeft = '';
item.style.borderRadius = '';
item.style.padding = '';
const existingMark = item.querySelector('.custom-complete-mark');
if (existingMark) existingMark.remove();
}
});
}
// 高级播放模式
function advancedPlayMode() {
if (!config.advancedMode) return;
// 1. 自动跳过广告
const ads = document.querySelectorAll('.ad, .advertisement, .video-ads');
ads.forEach(ad => {
ad.style.display = 'none';
});
// 2. 绕过播放限制(禁用弹窗和确认对话框)
const originalConfirm = window.confirm;
window.confirm = function() {
console.log('拦截了确认对话框');
return true;
};
const originalAlert = window.alert;
window.alert = function() {
console.log('拦截了警告对话框');
};
// 3. 强制后台播放
const videoElements = document.querySelectorAll('video');
videoElements.forEach(video => {
video.setAttribute('playsinline', '');
video.setAttribute('webkit-playsinline', '');
video.setAttribute('x5-playsinline', '');
video.addEventListener('pause', function(e) {
if (config.autoPlay && this.currentTime > 0 && !this.ended) {
setTimeout(() => {
if (!this.paused) return; // 如果已经恢复播放就不再操作
this.play().catch(() => {});
}, 500);
}
});
});
// 4. 自动调整播放质量
if (typeof videojs !== 'undefined') {
const player = videojs('video');
if (player && player.qualityLevels) {
const qualityLevels = player.qualityLevels();
qualityLevels.on('change', function() {
for (let i = 0; i < this.length; i++) {
// 启用所有质量级别
this[i].enabled = true;
}
});
}
}
}
// 设置视频播放速度
function setVideoPlaybackRate() {
// 方法1: 直接查找video元素
const videoElements = document.querySelectorAll('video');
videoElements.forEach(video => {
try {
video.playbackRate = config.customSpeed;
console.log('已设置视频播放速度:', config.customSpeed);
} catch (e) {
console.error('设置播放速度失败:', e);
}
});
// 方法2: 尝试查找播放器实例
if (window.videoPlayer) {
try {
window.videoPlayer.setPlaybackRate(config.customSpeed);
} catch (e) {
console.log('播放器不支持直接设置速度');
}
}
// 方法3: 尝试使用常见播放器API
if (window.player) {
try {
window.player.setPlaybackRate(config.customSpeed);
} catch (e) {
console.log('player实例不支持设置速度');
}
}
// 方法4: 尝试使用mediaplayer
if (window.mediaplayer) {
try {
window.mediaplayer.setPlaybackRate(config.customSpeed);
} catch (e) {
console.log('mediaplayer不支持设置速度');
}
}
}
// 自动播放并静音
function playVideoWithMute() {
if (!config.autoPlay) return;
const videoElements = document.querySelectorAll('video');
if (videoElements.length > 0) {
videoElements.forEach(video => {
try {
// 静音
if (config.autoMute) {
video.muted = true;
}
// 播放视频
video.play().then(() => {
console.log('视频已开始自动播放');
}).catch(error => {
console.log('自动播放失败,尝试用户交互后播放:', error);
// 尝试通过点击播放按钮
clickPlayButton();
});
} catch (e) {
console.error('播放视频时出错:', e);
}
});
} else {
console.log('未找到视频元素,尝试点击播放按钮');
clickPlayButton();
}
}
// 点击播放按钮
function clickPlayButton() {
const playButtons = document.querySelectorAll(
'.vjs-play-button, .ant-btn-play, .play-btn, .btn-play, .play-icon, .icon-play, [class*="play"], [aria-label="播放"]'
);
playButtons.forEach(button => {
try {
// 创建点击事件
const event = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
button.dispatchEvent(event);
console.log('已点击播放按钮');
} catch (e) {
console.error('点击播放按钮失败:', e);
}
});
}
// 自动跳转下一节视频
function autoJumpToNextVideo() {
if (!config.autoNextVideo) return;
const videoElements = document.querySelectorAll('video');
videoElements.forEach(video => {
video.addEventListener('ended', function() {
console.log('视频播放结束,准备跳转下一节');
// 查找下一节按钮
const nextButtons = document.querySelectorAll(
'.next-btn, .btn-next, [class*="next"], .btn_after, .ananas_next, [aria-label*="下一节"], [title*="下一节"]'
);
if (nextButtons.length > 0) {
nextButtons[0].click();
console.log('已点击下一节按钮');
} else {
console.log('未找到下一节按钮');
}
});
});
}
// 跳过已完成的视频
function skipCompletedVideos() {
if (!config.skipCompletedVideos) return;
// 检查是否为已完成的视频
const progressElements = document.querySelectorAll(
'.progressbar .progress, .progressBar, .progress-text, .time-current'
);
for (const element of progressElements) {
const text = element.textContent || '';
const style = element.style || {};
// 检查进度是否为100%或接近完成
if (text.includes('100%') || style.width === '100%') {
console.log('检测到已完成视频,尝试跳转到下一节');
// 查找下一节按钮
const nextButtons = document.querySelectorAll(
'.next-btn, .btn-next, [class*="next"], .btn_after, .ananas_next, [aria-label*="下一节"], [title*="下一节"]'
);
if (nextButtons.length > 0) {
nextButtons[0].click();
console.log('已跳过已完成视频');
}
break;
}
}
}
// 禁用页面监控功能
function disablePageMonitoring() {
if (!config.disablePageMonitoring) return;
// 禁用常见的监控方法
Object.defineProperty(document, 'visibilityState', {
get: function() {
return 'visible';
}
});
// 拦截visibilitychange事件
const originalAddEventListener = document.addEventListener;
document.addEventListener = function(type, listener, options) {
if (type === 'visibilitychange') {
console.log('拦截了visibilitychange事件监听');
return;
}
originalAddEventListener.call(this, type, listener, options);
};
// 禁用document.hasFocus()检查
Object.defineProperty(document, 'hasFocus', {
value: function() {
return true;
}
});
// 禁用窗口失焦检查
const originalWindowAddEventListener = window.addEventListener;
window.addEventListener = function(type, listener, options) {
if (type === 'blur') {
console.log('拦截了blur事件监听');
return;
}
originalWindowAddEventListener.call(this, type, listener, options);
};
// 模拟用户活动
setInterval(() => {
const event = new MouseEvent('mousemove', {
bubbles: true,
cancelable: true,
view: window
});
document.dispatchEvent(event);
}, 5000);
}
// 创建控制面板
function createControlPanel() {
// 添加样式
const style = document.createElement('style');
style.textContent = `
/* 控制面板样式 */
.chaoxing-control-panel {
position: fixed;
top: 20px;
right: 20px;
width: 320px;
background: #fff;
border-radius: 12px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
z-index: 9999;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
transition: all 0.3s ease;
border: 1px solid #e0e0e0;
}
.chaoxing-control-panel.dragging {
cursor: grabbing;
box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}
.chaoxing-panel-title {
background: linear-gradient(135deg, #4a90e2 0%, #6a5acd 100%);
color: white;
padding: 16px 20px;
border-radius: 12px 12px 0 0;
font-size: 16px;
font-weight: 600;
cursor: grab;
display: flex;
justify-content: space-between;
align-items: center;
}
.chaoxing-panel-title:active {
cursor: grabbing;
}
.chaoxing-settings-container {
padding: 20px;
}
.chaoxing-setting-item {
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 0;
transition: all 0.2s ease;
}
.chaoxing-setting-item:hover {
background-color: #f8f9fa;
padding-left: 8px;
padding-right: 8px;
border-radius: 6px;
}
.chaoxing-setting-label {
font-size: 14px;
font-weight: 500;
color: #333;
flex: 1;
}
/* 开关按钮样式 */
.chaoxing-switch {
position: relative;
display: inline-block;
width: 52px;
height: 26px;
}
.chaoxing-switch input {
opacity: 0;
width: 0;
height: 0;
}
.chaoxing-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: 0.4s;
border-radius: 34px;
}
.chaoxing-slider:before {
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 3px;
bottom: 3px;
background-color: white;
transition: 0.4s;
border-radius: 50%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
input:checked + .chaoxing-slider {
background: linear-gradient(135deg, #4a90e2 0%, #6a5acd 100%);
}
input:focus + .chaoxing-slider {
box-shadow: 0 0 1px #4a90e2;
}
input:checked + .chaoxing-slider:before {
transform: translateX(26px);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
/* 播放速度选择器样式 */
.chaoxing-speed-selector {
width: 120px;
padding: 8px 12px;
border: 2px solid #e0e0e0;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
background-color: white;
color: #333;
cursor: pointer;
transition: all 0.2s ease;
outline: none;
}
.chaoxing-speed-selector:hover {
border-color: #4a90e2;
box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}
.chaoxing-speed-selector:focus {
border-color: #4a90e2;
box-shadow: 0 2px 12px rgba(74, 144, 226, 0.25);
}
/* 按钮容器样式 */
.control-buttons {
display: flex;
gap: 10px;
justify-content: center;
padding: 0 20px 20px;
}
/* 重置按钮样式 */
.reset-btn, .hide-btn {
padding: 8px 16px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.2s ease;
}
.reset-btn {
background-color: #f0ad4e;
color: white;
}
.reset-btn:hover {
background-color: #ec971f;
transform: translateY(-1px);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.hide-btn {
background-color: #5bc0de;
color: white;
}
.hide-btn:hover {
background-color: #31b0d5;
transform: translateY(-1px);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
/* 联系方式样式 */
.contact-info {
margin-top: 20px;
padding: 15px 20px;
border-top: 2px solid #f0f0f0;
font-size: 13px;
color: #666;
text-align: center;
font-weight: 500;
}
`;
document.head.appendChild(style);
// 创建面板元素
const panel = document.createElement('div');
panel.className = 'chaoxing-control-panel';
// 创建标题
const title = document.createElement('div');
title.className = 'chaoxing-panel-title';
title.textContent = '学习通视频助手';
// 创建设置容器
const settingsContainer = document.createElement('div');
settingsContainer.className = 'chaoxing-settings-container';
// 功能配置项
const features = [
{ id: 'autoPlay', label: '自动播放视频' },
{ id: 'autoMute', label: '自动静音' },
{ id: 'autoNextVideo', label: '自动跳转下一节' },
{ id: 'skipCompletedVideos', label: '跳过已完成视频' },
{ id: 'disablePageMonitoring', label: '禁用页面监控' },
{ id: 'advancedMode', label: '高级播放模式' },
{ id: 'highlightCompleted', label: '高亮已完成视频' }
];
// 创建设置项
features.forEach(feature => {
const settingItem = document.createElement('div');
settingItem.className = 'chaoxing-setting-item';
const label = document.createElement('label');
label.className = 'chaoxing-setting-label';
label.textContent = feature.label;
const switchContainer = document.createElement('label');
switchContainer.className = 'chaoxing-switch';
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.checked = config[feature.id];
checkbox.addEventListener('change', function() {
config[feature.id] = this.checked;
saveConfig();
console.log(`${feature.label} 设置为: ${this.checked}`);
});
const slider = document.createElement('span');
slider.className = 'chaoxing-slider';
switchContainer.appendChild(checkbox);
switchContainer.appendChild(slider);
settingItem.appendChild(label);
settingItem.appendChild(switchContainer);
settingsContainer.appendChild(settingItem);
});
// 创建播放速度选择器
const speedSettingItem = document.createElement('div');
speedSettingItem.className = 'chaoxing-setting-item';
const speedLabel = document.createElement('label');
speedLabel.className = 'chaoxing-setting-label';
speedLabel.textContent = '自定义播放速度';
const speedSelector = document.createElement('select');
speedSelector.className = 'chaoxing-speed-selector';
// 添加速度选项
const speeds = [0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0];
speeds.forEach(speed => {
const option = document.createElement('option');
option.value = speed;
option.textContent = `${speed}x`;
option.selected = speed === config.customSpeed;
speedSelector.appendChild(option);
});
speedSelector.addEventListener('change', function() {
config.customSpeed = parseFloat(this.value);
saveConfig();
setVideoPlaybackRate();
console.log('播放速度设置为:', config.customSpeed);
});
speedSettingItem.appendChild(speedLabel);
speedSettingItem.appendChild(speedSelector);
// 创建按钮容器
const buttonContainer = document.createElement('div');
buttonContainer.className = 'control-buttons';
// 创建重置按钮
const resetBtn = document.createElement('button');
resetBtn.className = 'reset-btn';
resetBtn.textContent = '重置设置';
resetBtn.addEventListener('click', function() {
if (confirm('确定要重置所有设置吗?')) {
config = {
autoPlay: true,
autoMute: true,
autoNextVideo: true,
skipCompletedVideos: true,
disablePageMonitoring: true,
customSpeed: 1.0,
advancedMode: true,
highlightCompleted: true
};
saveConfig();
// 重新加载页面以应用设置
location.reload();
}
});
// 创建关闭按钮
const hideBtn = document.createElement('button');
hideBtn.className = 'hide-btn';
hideBtn.textContent = '隐藏面板';
hideBtn.addEventListener('click', function() {
panel.style.display = 'none';
});
// 添加联系方式信息
const contactInfo = document.createElement('div');
contactInfo.className = 'contact-info';
contactInfo.innerHTML = '<span style="color: #4a90e2; font-weight: 600;">联系方式: wkwk796</span>';
// 添加面板拖拽功能
let isDragging = false;
let offsetX, offsetY;
title.addEventListener('mousedown', (e) => {
isDragging = true;
panel.classList.add('dragging');
// 计算鼠标相对于面板左上角的偏移量
const rect = panel.getBoundingClientRect();
offsetX = e.clientX - rect.left;
offsetY = e.clientY - rect.top;
// 防止文本选择
e.preventDefault();
});
document.addEventListener('mousemove', (e) => {
if (!isDragging) return;
// 计算新位置
const x = e.clientX - offsetX;
const y = e.clientY - offsetY;
// 应用新位置
panel.style.left = x + 'px';
panel.style.top = y + 'px';
// 移除right和bottom属性,避免冲突
panel.style.right = 'auto';
panel.style.bottom = 'auto';
});
document.addEventListener('mouseup', () => {
if (isDragging) {
isDragging = false;
panel.classList.remove('dragging');
}
});
// 添加显示/隐藏面板的切换功能
const togglePanel = () => {
panel.style.display = panel.style.display === 'none' ? 'block' : 'none';
};
// 添加快捷键支持(Alt+Z 显示/隐藏面板)
document.addEventListener('keydown', (e) => {
if (e.altKey && e.key === 'z') {
e.preventDefault();
togglePanel();
}
});
// 添加按钮到容器
buttonContainer.appendChild(resetBtn);
buttonContainer.appendChild(hideBtn);
// 将所有元素添加到面板中
panel.appendChild(title);
panel.appendChild(settingsContainer);
panel.appendChild(speedSettingItem);
panel.appendChild(buttonContainer);
panel.appendChild(contactInfo);
// 添加面板到文档中
document.body.appendChild(panel);
}
// 主函数
function main() {
// 确保配置已加载
loadConfig();
// 创建控制面板
createControlPanel();
// 禁用页面监控功能
if (config.disablePageMonitoring) {
disablePageMonitoring();
}
// 初始检查(给页面一些时间加载)
setTimeout(() => {
playVideoWithMute();
autoJumpToNextVideo();
skipCompletedVideos();
setVideoPlaybackRate();
advancedPlayMode();
highlightCompletedVideos();
}, 1500);
// 再次检查,确保视频元素已加载
setTimeout(() => {
playVideoWithMute();
autoJumpToNextVideo();
skipCompletedVideos();
setVideoPlaybackRate();
advancedPlayMode();
highlightCompletedVideos();
}, 3000);
// 定期检查,确保功能正常工作
setInterval(() => {
playVideoWithMute();
autoJumpToNextVideo();
skipCompletedVideos();
setVideoPlaybackRate();
advancedPlayMode();
highlightCompletedVideos();
}, 5000);
// 监听DOM变化,以便在动态加载的内容上应用功能
const observer = new MutationObserver(() => {
playVideoWithMute();
autoJumpToNextVideo();
skipCompletedVideos();
setVideoPlaybackRate();
advancedPlayMode();
highlightCompletedVideos();
});
observer.observe(document.body, {
childList: true,
subtree: true
});
console.log('学习通视频自动播放静音脚本已启动');
}
// 当页面加载完成后执行主函数
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', main);
} else {
main();
}
})();