福大长江雨课堂自用

福大长江雨课堂自用,无答题功能

目前為 2021-11-19 提交的版本,檢視 最新版本

// ==UserScript==
// @name         福大长江雨课堂自用
// @namespace    http://tmpermonkey.net/
// @version      0.2
// @description  福大长江雨课堂自用,无答题功能
// @author       alep
// @match        *://*.yuketang.cn/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        unsafeWindow
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @grant        GM_getResourceText
// @run-at       document-end
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function next_video(){
        var progress = document.querySelectorAll('span.text')[1].textContent.split(":")[1];
        console.log("检测到进度:" + progress);
        if(progress == "100%"){
            var tmp = window.location.href.split('/video/');
            var videoId = parseInt(tmp[1]);
            var nextURL = tmp[0] + "/video/" + (videoId + 1);
            window.location.href = nextURL;
        }else{
            setTimeout(next_video, 5000);
        }
    }


    var url = window.location.href;

    if (url.match("/video")){
        setTimeout(next_video, 5000);
    };
    // Your code here...
})();