您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
国家智慧教育公共服务平台(国家中小学智慧教育平台)自动刷视频,16倍速!
当前为
// ==UserScript== // @name 师德集中学习教育|国家智慧教育公共服务平台|国家中小学智慧教育平台|自动刷视频|16倍速|后台播放 // @namespace http://tampermonkey.net/ // @version 2023.7.5.002 // @description 国家智慧教育公共服务平台(国家中小学智慧教育平台)自动刷视频,16倍速! // @author You // @match https://www.smartedu.cn/* // @match https://basic.smartedu.cn/* // @icon https://www.google.com/s2/favicons?sz=64&domain=smartedu.cn // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; // Your code here... // 引入第三方库https://github.com/sweetalert2/sweetalert2/ // 引入 sweetalert2.min.css 和 sweetalert2.min.js 文件 const css = document.createElement('link'); css.rel = 'stylesheet'; css.href = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.css'; document.head.appendChild(css); const js = document.createElement('script'); js.src = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js'; document.body.appendChild(js); // 弹窗函数 function msg(txt, ms = 3000) { Swal.fire({ title: txt, position: 'center', icon: 'success', showConfirmButton: false, timer: ms, timerProgressBar: true, }) } var log = console.log; // 课程 var course_name = "师德集中学习教育(2023年7月)"; var home = "https://basic.smartedu.cn/training/71a83441-6d45-4644-80f0-00efa40df164"; var all_course = [ // 思想铸魂 "https://basic.smartedu.cn/teacherTraining/courseDetail?courseId=58979766-6cb2-43f8-8b6c-68336f8824df&tag=%E5%B8%88%E5%BE%B7%E9%9B%86%E4%B8%AD%E5%AD%A6%E4%B9%A0%E6%95%99%E8%82%B2&channelId=&libraryId=bb042e69-9a11-49a1-af22-0c3fab2e92b9&breadcrumb=%E5%B8%88%E5%BE%B7%E9%9B%86%E4%B8%AD%E5%AD%A6%E4%B9%A0%E6%95%99%E8%82%B2", // 固本强基 "https://basic.smartedu.cn/teacherTraining/courseDetail?courseId=10c4b18a-333a-48d2-a6ea-4a3524ea8e78&tag=%E5%B8%88%E5%BE%B7%E9%9B%86%E4%B8%AD%E5%AD%A6%E4%B9%A0%E6%95%99%E8%82%B2&channelId=&libraryId=bb042e69-9a11-49a1-af22-0c3fab2e92b9&breadcrumb=%E5%B8%88%E5%BE%B7%E9%9B%86%E4%B8%AD%E5%AD%A6%E4%B9%A0%E6%95%99%E8%82%B2", // 以案促学 "https://basic.smartedu.cn/teacherTraining/courseDetail?courseId=f47898b2-2138-4600-b08d-68856b1c7cb7&tag=%E5%B8%88%E5%BE%B7%E9%9B%86%E4%B8%AD%E5%AD%A6%E4%B9%A0%E6%95%99%E8%82%B2&channelId=&libraryId=bb042e69-9a11-49a1-af22-0c3fab2e92b9&breadcrumb=%E5%B8%88%E5%BE%B7%E9%9B%86%E4%B8%AD%E5%AD%A6%E4%B9%A0%E6%95%99%E8%82%B2", // 师德引领 "https://basic.smartedu.cn/teacherTraining/courseDetail?courseId=f7a2a557-7948-4d9b-93df-8622430d0df3&tag=%E5%B8%88%E5%BE%B7%E9%9B%86%E4%B8%AD%E5%AD%A6%E4%B9%A0%E6%95%99%E8%82%B2&channelId=&libraryId=bb042e69-9a11-49a1-af22-0c3fab2e92b9&breadcrumb=%E5%B8%88%E5%BE%B7%E9%9B%86%E4%B8%AD%E5%AD%A6%E4%B9%A0%E6%95%99%E8%82%B2", ] function answer() { // msg("答题。。。"); } function click(auto_next = true) { // 进行中 var icon = document.getElementsByClassName("iconfont icon_processing_fill")[0]; // 未开始 if (!icon) { icon = document.getElementsByClassName("iconfont icon_checkbox_linear")[0]; } // 有没学完的 if (icon) { icon.click(); } else { if (auto_next) { next(); } else { Swal.fire("当前页面所有视频已经播放完!", "", "success"); } } } function play(v = null) { if (!v) { v = document.getElementsByTagName("video")[0]; } if (v) { v.muted = true; v.playbackRate = 16; v.play(); } } function next() { var href = window.location.href; var index = all_course.indexOf(href); if (index > -1) { if (index + 1 < all_course.length) { window.location.href = all_course[index + 1]; } else { window.location.href = home; } } else { window.location.href = all_course[0]; } } function main() { log("main..."); // 等待页面加载,延时开始 var delay = 1000 * 10 var href = window.location.href; if (all_course.includes(href)) { msg(`等待网页资源加载, 约【${delay / 1000}】秒后开始自动播放视频`, delay); setInterval(function () { click(); play(); answer(); }, delay); } else { Swal.fire({ icon: "question", title: '开始刷视频?', text: "好好学习,天天向上!", showDenyButton: true, showCancelButton: true, confirmButtonColor: 'green', confirmButtonText: `刷脚本配置的课程,当前为:${course_name}`, denyButtonColor: "blue", denyButtonText: "只刷当前页的视频", cancelButtonColor: 'red', cancelButtonText: '退出', }).then((result) => { /* Read more about isConfirmed, isDenied below */ if (result.isConfirmed) { msg("走你~"); next(); } else if (result.isDenied) { msg(`【${delay / 1000}】秒后开始自动播放视频`, delay); setInterval(function () { click(false); play(); answer(); }, delay); } }) } } window.onload = main; })();