您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Automatically play and continue videos on GaoXiaoBang.
当前为
// ==UserScript== // @name 高校邦视频自动播放 // @namespace https://tampermonkey.net/ // @version 2025-04-10 // @description Automatically play and continue videos on GaoXiaoBang. // @author Nyaser // @match *://*.class.gaoxiaobang.com/class/*/unit/*/chapter/* // @icon https://www.google.com/s2/favicons?sz=64&domain=gaoxiaobang.com // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; var video; function goNext() { var next = document.querySelector("#chapterLayout > div.chapter-info > span.chapter-next.gxb-cur-point > i"); console.log("Moving to next chapter"); next.click(); } function heartbeat() { if (video.paused) { console.log("Resuming playback"); video.play(); } var progress = document.querySelector("div.cont > div.clear-fix.videoTit > div.progress > span"); if (progress !== null) { console.log("Current progress:", progress.innerText + "%"); if (progress.innerText == "100") { console.log("Progress reached 100%"); goNext(); } } else { console.log("Progress element not found"); goNext(); } } function checkVideoWithRetry(attempts) { return new Promise((resolve) => { function checkVideo() { video = document.querySelector("#video_player_html5_api"); if (video) { video.muted = true; video.play(); console.log("Video found and muted"); resolve(true); } else if (attempts > 0) { console.log("Video not found, retrying in 1 second"); console.log("Attempts left:", attempts); setTimeout(checkVideo, 1e3); attempts--; } else { console.log("Video not found after all attempts"); resolve(false); } } checkVideo(); }); } function activate() { checkVideoWithRetry(3) .then(res => { if (res) setInterval(heartbeat, 1e3); else goNext(); }) } window.onload = activate; })();