(秒过修复)2024年智慧中小学暑假教师研修秒过,慢慢点,多点几次!看B站视频

(秒过)秒过2024年智慧中小学暑假教师研修,有问题可以联系我https://space.bilibili.com/15344563。其他人均为假冒,不要相信刷课平台。刷课效果可以见 https://www.bilibili.com/video/BV1pT4m1S7Cd 感谢@XiaoTong6666大佬提供的思路!

目前為 2024-07-24 提交的版本,檢視 最新版本

// ==UserScript==
// @name         (秒过修复)2024年智慧中小学暑假教师研修秒过,慢慢点,多点几次!看B站视频
// @namespace    http://tampermonkey.net/
// @version      0.56
// @author       hydrachs
// @description  (秒过)秒过2024年智慧中小学暑假教师研修,有问题可以联系我https://space.bilibili.com/15344563。其他人均为假冒,不要相信刷课平台。刷课效果可以见 https://www.bilibili.com/video/BV1pT4m1S7Cd    感谢@XiaoTong6666大佬提供的思路!
// @license MIT
// @match        https://basic.smartedu.cn/*
// @match        https://www.smartedu.cn/*
// @match        https://teacher.vocational.smartedu.cn/*
// @match        https://core.teacher.vocational.smartedu.cn/*
// ==/UserScript==

(function() {
    'use strict';

    function runCodeInConsole(code) {
        var script = document.createElement('script');
        script.textContent = code;
        (document.head || document.documentElement).appendChild(script);
        script.remove();
    }

    function clickKnowButton() {
        var knowButton = document.querySelector('.fish-modal-confirm-btns .fish-btn-primary');
        if (knowButton) {
            knowButton.click();
        }
    }

    function setVideoToLastSecond(video) {
        if (video) {
            video.addEventListener('loadedmetadata', function() {
                video.currentTime = video.duration - 1;
            });
        }
    }

    function checkAndClickKnowButton() {
        var knowButton = document.querySelector('.fish-modal-confirm-btns .fish-btn-primary');
        if (knowButton) {
            knowButton.click();
            clearInterval(knowButtonCheckInterval); // 弹窗已处理
        }
    }

    function setVideoPlayPosition(video, time) {
        if (video) {
            video.currentTime = time;
        }
    }

    document.addEventListener('click', function(event) {
        if (event.button === 0) {
            clickKnowButton();

            var knowButtonCheckInterval = setInterval(checkAndClickKnowButton, 500); // 每500毫秒检查一次

            setTimeout(function() {
                runCodeInConsole(`document.querySelector("video").dispatchEvent(new Event("ended"))`);
                runCodeInConsole(`
                    var v = document.querySelector("video");
                    if (v) {
                        v.muted = true;
                        v.playbackRate = 1.0;
                        v.play();
                    }
                `);

                var video = document.querySelector("video");
                setVideoToLastSecond(video);

                setVideoPlayPosition(video, video.duration - 0.1); // 干就完啦

                // 屎山代码,就问你怕不怕
                for (var i = 0; i < 2; i++) {
                    setVideoPlayPosition(video, video.duration - 0.1);
                }
            }, 300);
        }
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址