Greasy Fork

来自缓存

Greasy Fork is available in English.

(16倍速)国家中小学智慧教育平台刷课脚本(支持“暑期教师研修”专题)

try to take over the world

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         (16倍速)国家中小学智慧教育平台刷课脚本(支持“暑期教师研修”专题)
// @namespace    http://tampermonkey.net/
// @version      0.5
// @license      CC BY-NC-SA
// @description  try to take over the world
// @author       Zed Wong
// @match        https://*.zxx.edu.cn/*
// @match        https://*.smartedu.cn/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    setTimeout(main, 5000);
    function main(){
        console.log('刷课脚本开始运行');
        var vid = document.getElementsByTagName("video")[0];
        vid.muted = true;
        vid.play();
        console.log('开始播放');
document.querySelector('video').playbackRate = 16;
        var total_ep = document.getElementsByClassName('resource-item').length;
        console.log('总共集数: ${total_ep}');

        var current_index;
        document.getElementsByClassName('resource-item').forEach(function(element,index)
        { if (element.classList.length === 3) 
        { 
            current_index = index;
        }});
        console.log('当前集号: ${current_index}');

        vid.addEventListener('ended', function() {
            console.log('当前记号:',current_index, ' 总记号:', total_ep);
            if (current_index <= total_ep) {
                console.log('播放结束,切换下一个视频');
                //document.getElementsByClassName('resource-item')[current_index].click();
                document.getElementsByClassName('resource-item')[current_index+=1].click();
                console.log('已切换到视频${current_index}');
                setTimeout(main, 5000);
                console.log('开始刷视频${current_index}');
                var vid = document.getElementsByTagName("video")[0];
                vid.muted = true;
                vid.play();
                console.log('开始播放');
                document.querySelector('video').playbackRate = 16;
            } else {
                console.log("该章节已挂机完成。");
            }
        }, false);
    }
})();